|
|
 |
RE: FN-FORUM: MySQL query/table optimisation
date posted 23rd January 2007 13:57
[EMAIL REMOVED] wrote:
> The query is finding the range to which a number belongs to,
> between two unsigned ints so currently I'm using "SELECT *
> FROM ranges WHERE ( start time for the higher values, less long on subsequent queries
> to the same table. The table contains a little over 4000000 rows.
>
> I have a combined index on start and end ( a single index
> covering both ) and the table is one that contains data that
> only gets updated occasionally on a complete bulk insert so I
> can afford to add any read optimisations necessary.
ben,
Not an expert, but I would imagine separate indexes (indices?) on start and
end would be necessary here, as a single index will be ordered first on
whichever column you list first and only then on the second column. This
means the first criterion (start |
 |
|