David Griffiths wrote:
Really? I had no idea. I am pretty sure that only Day will have a range.
Our index is currently, (yearmonth, day, stem_base), so I need to drop
and recreate it.
I think part of the slowness is the size of the table as well. We have
data going back years in there. I am
Mysql uses multiple-column indexes from left to right. Multiple-column
indexes are most effective when the column with a range criteria comes as
far to the right as possible. Think of the index as sorting your data into
a book where the first column is the chapter, the second column is the
Really? I had no idea. I am pretty sure that only Day will have a range.
Our index is currently, (yearmonth, day, stem_base), so I need to drop
and recreate it.
I think part of the slowness is the size of the table as well. We have
data going back years in there. I am thinking about breaking
We have a table with 40 million rows. It has statistics on traffic from
our website. Logs are processed once a night, and the data from those
logs are added.
Our table (traffic_boats, InnoDB) has three columns of interest:
day INT
yearmonth INT
stem_base VARCHAR(100)
There is an index on day,
Subject: Optimizer Index Weirdness
We have a table with 40 million rows. It has statistics on traffic from
our website. Logs are processed once a night, and the data from those
logs are added.
Our table (traffic_boats, InnoDB) has three columns of interest:
day INT
yearmonth INT