Re: Simple query seems to be ignoring date index
Posted by:
Rick James
Date: November 02, 2013 09:59PM
If this is the most common query:
SELECT * FROM test WHERE Date='2008-10-1';
You need some INDEX _starting_ with Date.
PRIMARY KEY(Sym, Date), INDEX(Date)
or
PRIMARY KEY(Date, Sym), INDEX(Sym)
Either of those would provide the UNIQUEness constraint (the PRIMARY KEY). In MyISAM, either would make the allow that SELECT to be somewhat efficient. It will be even more efficient if the data is INSERTed in Date order. If you get new data each day, than that is the order of insertion.
Subject
Views
Written By
Posted
3161
October 26, 2013 11:38AM
1161
October 28, 2013 08:56AM
1075
October 28, 2013 09:35PM
1083
October 29, 2013 10:19AM
1191
October 30, 2013 07:47PM
1148
October 31, 2013 12:23AM
1113
November 01, 2013 02:47AM
1193
November 01, 2013 11:20AM
1374
November 01, 2013 10:45PM
1105
November 02, 2013 09:45PM
Re: Simple query seems to be ignoring date index
1163
November 02, 2013 09:59PM
1202
November 04, 2013 04:55AM
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.