Jump to content

SELECT more than one table


harkly

Recommended Posts

I am selecting info from around 13 tables and I was wondering if there is a more efficient way to do this then what I have done. Mine does work so just wondering.

 

WHERE about_me.userID = 'test' AND pets.userID = 'test'  AND appearance.userID = 'test'  AND eg.userID = 'test'  AND interest.userID = 'test'  AND exercise.userID = 'test'  AND art.userID = 'test'  AND hobbies.userID = 'test'  AND music.userID = 'test'  AND rlat.userID = 'test'  AND user.userID = 'test' AND photos.userID = 'test' AND bkgd.userID = 'test'") or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/185418-select-more-than-one-table/
Share on other sites

When you have data scattered all around different tables, the only way to optimize a heavy join is to index periodically and select your *whatever_id* from the index table. This is common practice for example on searches where the best efficiency is required on select whereas a few seconds delay on update/insert is tolerable.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.