Re: [PERFORM] date - range

2005-04-02 Thread Bruno Wolff III
On Sat, Apr 02, 2005 at 00:01:31 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Fri, Apr 01, 2005 at 09:59:44PM -0800, Mischa wrote: > > > > > > select ... where first_date <= today and last_date >= today > > > > > > Whatever index we create system always does a sequential scan (whic

Re: [PERFORM] date - range

2005-04-01 Thread Michael Fuhr
On Fri, Apr 01, 2005 at 09:59:44PM -0800, Mischa wrote: > > > > select ... where first_date <= today and last_date >= today > > > > Whatever index we create system always does a sequential scan (which I can > > understand). Has someone a smarter solution? > > Yep, standard SQL problem. The

Re: [PERFORM] date - range

2005-04-01 Thread Mischa
Quoting Mischa <[EMAIL PROTECTED]>: [deleted] > SELECT People.* FROM People > JOIN Widths > ONPeople.start = today - today % Widths.width > AND People.width = Widths.width Yikes! I hit the SEND button one ohnosecend too fast. (1) You still ALSO have to test: ... AND today between first_d

Re: [PERFORM] date - range

2005-04-01 Thread Mischa
Quoting "H.J. Sanders" <[EMAIL PROTECTED]>: > > Anybody a solution for the next problem: > people can subscribe to a service for 1 or more days (upto a max. of 365). > So in the database is stored: first_date and last_date > To select which people are subscribed for a certain date (e.g. today) we

Re: [PERFORM] date - range

2005-04-01 Thread Michael Fuhr
On Fri, Apr 01, 2005 at 12:05:44PM +0200, H.J. Sanders wrote: > > people can subscribe to a service for 1 or more days (upto a max. of 365). > > So in the database is stored: first_date and last_date > > To select which people are subscribed for a certain date (e.g. today) we use > a select like

[PERFORM] date - range

2005-04-01 Thread H.J. Sanders
Anybody a solution for the next problem: people can subscribe to a service for 1 or more days (upto a max. of 365). So in the database is stored: first_date and last_date To select which people are subscribed for a certain date (e.g. today) we use a select like select ... where first_dat