I am relatively new to using SQL, and have come up against a problem (perhaps it is mis-use on my part, or maybe there is a work around). Here is my scenario...
I have five tables.
Table 1: A listing of documents Table 2-5: Reviews of the documents listed in the above table
Tables 2-5 are linked by a field docid. If the tables 2-5 contain the matching docid, then the review is returned from that table. Something to note is that a document will only be listed as 1 document type (and cannot be changed).
Currently I am using 4 "LEFT JOIN " statements, then using PHP to see which table returned a match.
This is creating ridiculously slow load times. If I break it apart, each one seems to load more efficiently.
My other thought is to combine the 4 tables into one (but the fields used in each are all unique, with a few exceptions, so I didn't think this would be a good solution).
Any help that can be offered would be greatly appreciated.
Thanks!