Home » Performance » MySQL » Data not being retrieved from index
Data not being retrieved from index [message #1762] Fri, 07 September 2007 17:30
claudiogarcia  is currently offline claudiogarcia
Messages: 1
Registered: September 2007
Junior Member
Hello!

My name is Claudio Garcia and I'm new to this forum. I would appreciate your help with the following problem.

I have a table with 5 columns, all of them integers, except column C, which is type text. I have the following query:

EXPLAIN SELECT D, E 
    FROM some_table 
    WHERE
    A = 1
    AND B = 1
    AND C IS NOT NULL;

And the following index:

KEY( A, B, C(1), D, E )


The index works fine to find the rows, but I include D and E in the index so that they can be retrieved from the index instead of being read from disk.

The problem is that D and E won't be retrieved from the index.

So MySQL can use the index to find which rows have a non-null value in C, but it cannot retrieve D and E from the index, even though they're in it. Is this a bug in MySQL?

If I make C be an integer type, then it works as expected.

Thanks in advance!

Claudio
Previous Topic:increase int column via UPDATE, without SELECT
Next Topic:Insert performance question
Goto Forum:
  


Current Time: Fri Jul 10 00:19:19 EDT 2009

Total time taken to generate the page: 0.01088 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.