SQL is awfully slow...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
legend986
Forum Contributor
Posts: 258
Joined: Sun Jul 15, 2007 2:45 pm

SQL is awfully slow...

Post by legend986 »

When I'm running a few statements through mysql console, they are working just fine but when I'm trying to write some logic in php and trying to execute it, its awfully slow.. Its perhaps performing, 10 queries in 20 seconds... :( Why is this happening?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

I would suggest you start by using your favourite search engine for database optimisation. To be honest it could a slew of different things... You don't really give us any information to work with so here are a couple of pointers... EXPLAIN ANALYZE is your friend. Do you use numeric indexes (searching numeric is quicker than text) ? Do you use indexes for only the information you need to as too many indexes can slow things down ? If using MySQL are you using the right table types.
Post Reply