--- "Keith C. Ivey" <[EMAIL PROTECTED]> wrote: > On 21 Nov 2002, at 15:18, Hans Zaunere wrote: > > > Because it seems ineffncient to me, as MySQL must be doing more work to > > calculate the range. Even EXPLAIN tells me this, by showing that a > > less-than-optimal TYPE is being used. Although "WHERE thecolumn = > > '2002-11-17'" doesn't yield any results, EXPLAIN shows that it's using a > > better index type. > > Yes, EXPLAIN says that the type is 'range' rather than 'ref', but > you're doing a range query. That's the best you can get for your > query, so there's no point in worrying about what might be optimal > for a different sort of query.
But in fact that's not the query I'm doing. It's a range query only because that's the only way I've found to accomplish what I need - if I could compare against only the date part, it wouldn't be a range query. > The light for searching might be > optimal under the lamppost rather than in the alley, but if you > dropped your keys in the alley you have to search for them there. Yeah... but my key is in the light, except it's inexplainably invisible. > If you never care about the time portion of the column, then it would > be better to make it a DATE column, Of course, but the time is important at times (yeah, I could split it into different columns, but that's not at issue). > but as long as it's a DATETIME > column then you are looking for a range of values, so 'range' is the > best you're going to get in the EXPLAIN output. Yes, but the real data I'm looking for is not a range - it's simply a part of a single value. In Oracle the DATE column type contains date and time information. However, one can query only for the date, and Oracle will honor that as what it needs to pick out of the column. I had hoped that MySQL would do the same, since it looks like it stores the data in a very similar way. Best, ===== Hans Zaunere New York PHP http://nyphp.org [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php