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!