SQL Join Performance questions

Discussion created by kaostika on May 3, 2013
Latest reply on May 7, 2013 by kaostika



Lets say I have 5 tables. I want to recreate the Data Model in SQL with JOINs.


I then want to get the result in a text field. So rather than re write the JOIN portion of the sql each time I make a new query can I write it once and use it for all my queries. Even if I dont use the fields from the tables referenced in the JOIN.


For Example


I JOIN invoices, Line items, Contacts, Address, and Prodcuts. I run SQL query but I only SELECT the fields from Products and Contacts.


I want to keep all the JOIN text. Will this slow things down? Or is this just a bad practice. I am trying to write the JOIN once to recreate my data model and leave it. Maybe put the text into a CF