Re: Finding overlapping intervals efficiently

2002-02-25 Thread Colin Dewey
I did some playing around with various indices on the tables and found that the fastest configuration was without any indices! With two tables (t1 and t2) with fields "start" and "end", using an index (start, end) or indices on the on the two fields separately, the speed of joining the two tab

Re: Finding overlapping intervals efficiently

2002-02-24 Thread Arjen Lentz
Hi, On Sat, 2002-02-23 at 01:14, Tod Harter wrote: > This is an example of a class of problem that crops up in a lot of > applications, like GIS systems all the time. > > Unfortunately B-Tree type indexes, like RDBMS systems generally use are just > not well adapted to this type of query. I kn

Re: Finding overlapping intervals efficiently

2002-02-22 Thread Tod Harter
On Friday 22 February 2002 00:03, Colin Dewey wrote: This is an example of a class of problem that crops up in a lot of applications, like GIS systems all the time. Unfortunately B-Tree type indexes, like RDBMS systems generally use are just not well adapted to this type of query. I know Infor

Finding overlapping intervals efficiently

2002-02-21 Thread Colin Dewey
Given two tables (t1 and t2) with fields "start" and "end", what is the most efficient method of finding the all the intervals in the first table that overlap any interval in the second table? Right now, I use a query like: SELECT t1.name, t2.name FROM t1, t2 WHERE t1.start <= t2.end AND t1.en