Forum Moderators: open
Quick Overview of current structure (simplified down)
Advertisers { id, Business Name, Address, County, Phone, Category Code } (Approx 80,000 rows)
Categories { id, Category Code, Name } (Approx 900 rows)
Results are filtered by Category Code & by County
My initial idea is to take the 80,000 rows from the main table. Make a table for each county and sort them out that way. Max counties would be 32. Anyone have any better ideas?
Thanks,
T
I have to wonder why you have a 'like' in the query when you are searching for an exact value? If you added indexes with the codes separate and one with the codes together, and changed the query to the one below, you'd cover all the queries for the codes and it should be very fast.
SELECT COUNT(Business_Name) FROM Advertisers WHERE Sub_Category_Code = '$category' AND County_Code = '$coCode'
JAG