Subject | Re: [firebird-support] Query using a range in where/having clause? |
---|---|
Author | Arno Brinkman |
Post date | 2004-06-08T07:14:12Z |
Hi,
1.
could really increase performance by using this :
(ScheduleStart >= UserEnd - X) and (ScheduleStart <= UserEnd) and
(ScheduleEnd >= UserStart) and (ScheduleEnd <= UserStart + X)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
> >> ((ScheduleStart < UserStart) and (ScheduleEnd > UserEnd)) ORIf here indexes can be used then 4 bitmaps are setup and finally combined to
> > (ScheduleStart BETWEEN UserStart and UserEnd) OR (ScheduleEnd BETWEEN
> > UserStart and UserEnd)
1.
> > What about (ScheduleStart < UserEnd) and (ScheduleEnd > UserStart) ?Only 2 indexes are used and combined.
> Can you give me an example where I would need this condition and thatIf you're 100% sure that any schedule is never greather than X days then you
> it wouldn't be covered by any of the 3 conditions that I mentioned?
> I'm just curious and can't currently think of one.
could really increase performance by using this :
(ScheduleStart >= UserEnd - X) and (ScheduleStart <= UserEnd) and
(ScheduleEnd >= UserStart) and (ScheduleEnd <= UserStart + X)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info