How do I index to speed up OVERLAPS? - Mailing list pgsql-general

From Matthew Wilson
Subject How do I index to speed up OVERLAPS?
Date
Msg-id slrngj3cd4.b3g.matt@sprout.tplus1.com
Whole thread Raw
Responses Re: How do I index to speed up OVERLAPS?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
I have a table shift with a start_time column and a stop_time column and
I do a lot of queries like:

    select * from shift
    where (start_time, stop_time) overlaps ($A, $B);

$A and $B are user-submitted values.

Anyhow, how do I put indexes on my table to make these queries run
faster?

Also, is there a better data type to use for ranges of time?

TIA

Matt

pgsql-general by date:

Previous
From: ries van Twisk
Date:
Subject: Re: Install question on Mac Leopard Server 10.5
Next
From: ries van Twisk
Date:
Subject: Re: Install question on Mac Leopard Server 10.5