![]() |
Trouble using LEFTJOIN when table 2 contains 60,000+ records!
I am having BIG problems with pageload times when executing the following query:
PHP Code:
FYI, the function i have created to display the results is as follows: PHP Code:
Thanks in advance for your assistance :) |
What indexes do you have on the tables ?
Can you run in debug mode, and then the explain view, and post the result. |
1 Attachment(s)
Thanks, for dma table, my source is as follows:
Code:
`dmacode` int(10) unsigned NOT NULL auto_increment, Code:
`venueid` int(6) unsigned NOT NULL auto_increment, Code:
SELECT erc_venue.*, dma.* |
bump
|
Add an index on your zipcode columns (both tables) - this will help a lot.
Also, if you alias your tables - you will no longer have to specify the table prefix all over the place: PHP Code:
|
Thanks SirAdrian,
that was exactly the problem. I had indexed `dmacode` but needed to also create an index on `zipcode`. The query SCREAMS now. thanks again :) (going to work on using aliases from now on as well) |
All times are GMT. The time now is 09:48 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|