The parantheses come from a php function that is writing the statement. i
know they aren't  needed.

I've seen the same results on another table with an enum with values like
'a','b','c','d', so although i haven't modified this specic query to not use
the reservered word true. i know the same results are happening elsewhere
where i don't use it. and since it's a string, it wouldn't know that its a
reserved word.

both queries would have the limit on them, so they would only return 10
rows. but yes, there are probably about 10x as many records with true than
with anything else.

On 7/4/06, John Hicks <[EMAIL PROTECTED]> wrote:

Tanner Postert wrote:
> so i am doing a query on an enum field:
> when i do this query:
>
> select *, id as vid, user_id as uid from video where (file_complete =
> 'true') order by undt desc limit 0,10;
>
> the results are 0.16 or 0.17 seconds.
>
> instead of saying file_complete = 'true. if i say file_complete != to
the
> other 5 possible enum values. the query returns in 0.00 sec.
>
> there is an index on that field... shouldn't  the = 'true' query be
faster?
> i just dont understand.
>


Are there more rows returned for 'true' than for the other values?

Have you tried using something other than a reserved word for 'true'?

What other values for file_complete could there be than true and false?

Why not define e.g. upload_status enum ('working', ...., 'complete').

(BTW you don't need those (parentheses) in your query.)

-J

Reply via email to