Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
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:

Re: Date v. DateTime index performance

2007-01-10 Thread Brent Baisley
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

Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
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

Re: Date v. DateTime index performance

2007-01-09 Thread Chris
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

Re: Date v. DateTime index performance

2007-01-09 Thread Anders Lundgren
> 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

Re: Date v. DateTime index performance

2006-12-04 Thread Dan Buettner
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