ay of the month and < the first day of the next month. That will
use an index.
- Original Message - From: "Anders Lundgren" <[EMAIL PROTECTED]>
To: "Dan Buettner" <[EMAIL PROTECTED]>
Cc: "Thomas Bolioli" <[EMAIL PROTECTED]>;
Sent:
That will use an index.
- Original Message -
From: "Anders Lundgren" <[EMAIL PROTECTED]>
To: "Dan Buettner" <[EMAIL PROTECTED]>
Cc: "Thomas Bolioli" <[EMAIL PROTECTED]>;
Sent: Tuesday, January 09, 2007 8:34 PM
Subject: Re: Date v. DateTime
OK, thank you. How is the speed of this index compared with an indexed
date column if I do:
year_number='x' and month_number='y' and day_number='z';
They should have about the same cardinality, right?
Thanks,
Anders
Chris wrote:
Anders Lundgren wrote:
> One potential solution might be to
Anders Lundgren wrote:
> One potential solution might be to use an extra column that tracks
> month_number, and populate it with a trigger on insert or update.
> Index that field and then use it in your WHERE clause. One
> possibility anyway.
Resulting question, what if I have three colums
> One potential solution might be to use an extra column that tracks
> month_number, and populate it with a trigger on insert or update.
> Index that field and then use it in your WHERE clause. One
> possibility anyway.
Resulting question, what if I have three colums named year_number,
month_nu
Thomas, I do not think in this case that one is better than the other,
for the most part, because both require using a value computed from
the column. Computing month from a DATE field should be just as fast
as computing from a DATETIME column I would think.
Also splitting into DATE and TIME col
If one has a large number of records per month and normally searches for
things by month, yet needs to keep things time coded, does anyone know
if it make sense to use datetime or separate date and a time columns?
Thanks,
Tom
--
MySQL General Mailing List
For list archives: http://lists.mysql.c