btree gist indices, null and open-ended tsranges - Mailing list pgsql-general

From Chris Withers
Subject btree gist indices, null and open-ended tsranges
Date
Msg-id 18847817-c439-aacb-cb97-549eef1d1377@simplistix.co.uk
Whole thread Raw
Responses Re: btree gist indices, null and open-ended tsranges
List pgsql-general
Hi All,

Working with the exclude constraint example from
https://www.postgresql.org/docs/current/static/rangetypes.html:

CREATE EXTENSION btree_gist;
CREATE TABLE room_reservation (
     room text,
     during tsrange,
     EXCLUDE USING GIST (room WITH =, during WITH &&)
);

So, first observation: if I make room nullable, the exclude constraint
does not apply for rows that have a room of null. I guess that's to be
expected, right?

Next question: if lots of rows have open-ended periods
(eg: [, 2010-01-01 15:00) or [2010-01-01 14:00,)), how does that affect
the performance of the btree gist index backing the exclude constraint?

cheers,

Chris


pgsql-general by date:

Previous
From: Juliano
Date:
Subject: Overwrite pg_catalog?
Next
From: Francisco Olarte
Date:
Subject: Re: Overwrite pg_catalog?