List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 12 1999 11:27pm
Subject:varchar Vs. TIME and range searches
View as plain text  

>>>>> "Steve" == Steve Ruby <stever@stripped> writes:

Steve> So I assume I can take it as fact that Mysql Doesn't use
Steve> indexes on queries containing <,>,<=,>=,BETWEEN where the column
Steve> in question is type varchar or char? I tested this on
Steve> my winNT version a couple of days ago and posted to the list
Steve> because I can't find in the manual where this is backed up.

Steve> this leads me to the following question. Before the first
Steve> query you see here datatime is a varchar(8) with time in the
Steve> format HH:MM:SS you see the rest in the session below, why
Steve> is BETWEEN on TIME slower even with an index on both and
Steve> it uses the index varchar does not



I have answered you a couple of times already;  I hope you have got
this answered already;  (Yes, MySQL uses indexes on everything except
<>, but only if it thinks the query will be faster if it uses indexes)

varchar Vs. TIME and range searchesSteve Ruby22 Oct
  • Re: varchar Vs. TIME and range searchessinisa23 Oct
  • varchar Vs. TIME and range searchesMichael Widenius13 Nov
  • Re: varchar Vs. TIME and range searchesSteve Ruby15 Nov