Overlapping ranges - Mailing list pgsql-general

From Jason Long
Subject Overlapping ranges
Date
Msg-id 1403135264.14348.5.camel@localhost.localdomain
Whole thread Raw
Responses Re: Overlapping ranges
Re: Overlapping ranges
Re: Overlapping ranges
List pgsql-general
I have a large table of access logs to an application.

I want is to find all rows that overlap startdate and enddate with any
other rows.

The query below seems to work, but does not finish unless I specify a
single id.

select distinct a1.id
from t_access a1,
        t_access a2
where tstzrange(a1.startdate, a1.enddate) &&
      tstzrange(a2.startdate, a2.enddate)




pgsql-general by date:

Previous
From: Dave Peticolas
Date:
Subject: Question about detecting database changes
Next
From: Rob Sargent
Date:
Subject: Re: Overlapping ranges