NameSilo

Speed up MySQL query

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

dubya

Established Member
Impact
3
Hey all,

I have a database of around 400,000 business listings, with 30 or so fields.

When a user searches by zipcode and category, the search sometimes takes a minute or two based on the amount of data in that area.

Are there any corners I could cut, or simple queries I could run to speed up the process?

Any help, or resources would be great.

Thanks,
Dave
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
When a user searches by zipcode and category, the search sometimes takes a minute or two based on the amount of data in that area.

Hi Dave,

Try adding INDEXES to the `zipcode` and `category` fields. This will help considerably.

Regards,
Peter
 
0
•••
That seemed to work just fine.

Thanks, +rep!
 
0
•••
Also if your database had become fragmented from deletes you should use the optomise table tool.
 
0
•••
I would assume mysql is similar to postgre in that you can change the size of your buffer pool. You probably want it about 2/3 of your total memory so that it'll increase the chances of a hit while not hindering your overall performance. Adding additonal indexes will also help as psalzmann stated.
 
0
•••
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back