RE: Date query optimization

2003-07-02 Thread Rick Robinson
utious using functions in your where clause - you might get surprised. Best of luck, Rick -Original Message- From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 12:25 PM To: [EMAIL PROTECTED] Subject: Date query optimization Hi folks, I do a considerable amount o

Re: Date query optimization

2003-07-01 Thread Keith C. Ivey
On 1 Jul 2003 at 10:28, Karl J. Stubsjoen wrote: > > The normal way to do a search for a range of dates would be > > > >... WHERE a.submitdate BETWEEN '2003-07-01' AND '2003-07-14'; > > > > Is that what you're looking for? > > submitdate happens to be a DATETIME field. > Your suggested query

Re: Date query optimization

2003-07-01 Thread Karl J. Stubsjoen
Keith, > The normal way to do a search for a range of dates would be > >... WHERE a.submitdate BETWEEN '2003-07-01' AND '2003-07-14'; > > Is that what you're looking for? submitdate happens to be a DATETIME field. Your suggested query doesn't pull any results. Must I convert the field first?

Re: Date query optimization

2003-07-01 Thread Keith C. Ivey
On 1 Jul 2003 at 9:25, Karl J. Stubsjoen wrote: > ROWS: 34,000 + searched > explain > select > a.submitid,a.url,a.submitdate,a.name,a.company,a.address1,a.city,a.sta > te,a.z > ipcode,a.country,a.email,a.phone,a.keywords,a.title,a.description,a.su > bmitte dby from submit as a inner join re_idx as

Date query optimization

2003-07-01 Thread Karl J. Stubsjoen
Hi folks, I do a considerable amount of queries based on a date, and or date range. I have not had much luck with optimizing these queries. In some cases I use a date field and others a datetime field. The following query searches through 34,000 + records, while specifiying the exact date searche