Hi Kelvin, all!

Kelvin Wu wrote:
I am looking for help and suggestion.

Mysql Ver 12.18 Distrib 4.0.12, for pc-linux (i686)


The table structure:
[[...]]
I created multiple parts of Index for this table:
[[...]]

And here are the questions:

Q1: the query is supposed to use index bynone but ...
[[...]]
Q2: the query is supposed to use index bysource but ...
[[...]]
Using of "timestamp > 0" caused using different index on different source =
xxx... why is like that so?

Q3: the query is supposed to use index bycategory and it seems work fine so
far...
[[...]]

Any idea?

Very recently, there was another posting about an index not being used for a query, and the explanation was:

    If a "where condition" is matched by too many records in the table,
    the index is *intentionally* not used,
    because going through the index and then accessing (nearly) all the
    rows is more work than just scanning the table (and finding the many
    hits).

Remember that acessing a row is the main cost, and going through the index adds work. Doing that additional work only pays off if it saves accessing a sufficient number of rows. Check the row counts in your examples.

Please scan the list archive to find the discussion and the detailed references.


HTH,
Jörg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to