Fulfilling queries in tables with more than 1 million rows in

I index all the columns that I use in my Where / Order by, is there anything else I can do to speed up the queries?

The queries are very simple, for example:

SELECT COUNT(*) 
  FROM TABLE 
 WHERE user = id 
   AND other_column = 'something'`

I am using PHP 5, the MySQL client version is 4.1.22, and my tables are MyISAM.

+5
source share
2 answers

Talk to your database administrator. Run your local equivalent showplan. For a query similar to your sample, I suspect that the coverage index is in columns idand other_columnwill significantly speed up performance. (I assume it useris a variable or niladic function).

, . , , , , , , . , . .

+7

, , , , . ( , , .. ?)

, :

user + otherfield1
user + otherfield2
etc.

, , ( ).

"user + otherfield", , mysql . , .

+1

All Articles