MySQL Forums
Forum List  »  Optimizer & Parser

Re: How to speed up query of indexed column with 5M rows?
Posted by: Larry Kagan
Date: October 09, 2006 08:11AM

You've got 6 columns and 5 indexes. Generally speaking that's too much. Notice that your index file (MYI) is larger than the table itself (MYD). Cut down on the indexes. Also, you're using the full name column as an index, that's up to 255 chars! Cut that down and use a partial index.

KEY `flow_nameindex` (name(15)) -- Uses the first 15 chars of the column.

That should speed up your queries exponentially. If you want to take it a step further, make the name column a char(255). Yes, it will take up more space but will be much faster for I/O. This last change will only have a speed improvement for MyISAM tables.

Please respond back with the results of your changes.

Thanks,

Larry Kagan



Edited 2 time(s). Last edit at 10/09/2006 08:14AM by Larry Kagan.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to speed up query of indexed column with 5M rows?
9020
October 09, 2006 08:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.