MySQL Forums
Forum List  »  Optimizer & Parser

Re: Advice on indexing a datetime column
Posted by: Rick James
Date: July 27, 2010 10:29PM

Adding the datetime index will not hurt much. Such an index (assuming data is inserted in chronological order, or nearly so) will have a hot spot at the end, there for will require very little disk I/O.

"Hundreds per second" show be fine.

Consider using TIMESTAMP instead of DATETIME; the former is 4 bytes; the latter is 8. They hold equivalent information (except for timezone issues).

A GUID, on the other hand, would be running around all over the index, doing random read-modify-writes. Adding that would slow you down to disk speed.

SHOW CREATE TABLE for further discussion.

Options: ReplyQuote

Written By
Re: Advice on indexing a datetime column
July 27, 2010 10:29PM

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.