Re: Simple query seems to be ignoring date index
Thanks for the detailed analysis.
I tried LOADing the CSV file to a temporay table then INSERTing into the real table ORDERed By date and a) it works b) it's not unbearably slow and I don't have to do it unless I rebuild the entire table. It also works with the daily updates I do, although the data might eventually get scattered again.
I have InnoDB turned off because I originally used the default /var/lib for the database. It had 2 gigabytes available which filled up pretty quickly. When I discovered the InnoDB files were over 1 gig I deleted them and turned it off. The parition filled up again and I dedicated a 100 gig hard drive to the database. I turned InnoDB on again but it had problems so I turned it off. Probably something in my.cnf but I don't feel like delving into that right now.
The SELECT on 'date' is the one that gets called most often. I also have a PRIMARY KEY on (Symbol,Date) but that is mainly to ensure no duplicates. I don't even think I need the sym index.
ADD: I just dropped the Date index and reversed the PK to (Date,Symbol) and the Date lookup is just as fast.
Edited 1 time(s). Last edit at 11/02/2013 09:55PM by Greg Schubin.
Subject
Views
Written By
Posted
2903
October 26, 2013 11:38AM
1049
October 28, 2013 08:56AM
975
October 28, 2013 09:35PM
988
October 29, 2013 10:19AM
1075
October 30, 2013 07:47PM
1043
October 31, 2013 12:23AM
1005
November 01, 2013 02:47AM
1066
November 01, 2013 11:20AM
1254
November 01, 2013 10:45PM
Re: Simple query seems to be ignoring date index
1000
November 02, 2013 09:45PM
1054
November 02, 2013 09:59PM
1027
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.