MySQL Forums
Forum List  »  MySQL Workbench

Re: Newbie Trying to Expedite Query
Posted by: Ron Mittelman
Date: June 04, 2013 09:25AM

Thanks Mike,

The only column I really need for a PK is the auto-increment column.
Our retrieval query is always "Select <field list> From History Where run_date = '<some date>' And run_number = <some number> Order By <auto-increment-column>;"

Therefore, it seems like I need an index of run_date + run_number, right?

If I instead make the primary key run_date + run_number + auto-increment, and dispense with any other indexes, it seems like this would speed things up. I don't know enough to answer this, but wouldn't that also eliminate the need for "Order By <auto-increment-column>"?

Thanks...

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Newbie Trying to Expedite Query
598
June 04, 2013 09:25AM


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.