MySQL Forums
Forum List  »  Optimizer & Parser

Re: Double Index Performance
Posted by: Sebastien Caisse
Date: January 16, 2006 06:24AM

You could:
a) Make PostDate NOT NULL (MySQL supports a "0" date value).
b) CREATE a DESC non-UNIQUE INDEX for postDate
c) or better yet, CREATE a non-UNIQUE INDEX for (postDate DESC, PersonId DESC).

Though the MAX(PostDate) might be faster, from personal experience most of the time a LIMIT 1 has been shown to be faster, as it avoid the whole aggragetion processing...



Edited 1 time(s). Last edit at 01/16/2006 06:26AM by Sebastien Caisse.

Options: ReplyQuote


Subject
Views
Written By
Posted
8220
January 12, 2006 02:21PM
3164
January 13, 2006 05:18PM
Re: Double Index Performance
2806
January 16, 2006 06:24AM
2845
January 16, 2006 08:46AM
2448
January 17, 2006 06:45AM
2719
February 01, 2006 01:05PM


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.