Index on a range array - Mailing list pgsql-performance

From Daniel Cristian Cruz
Subject Index on a range array
Date
Msg-id CACffM9HGyvh0OqwS7KbMLJ+zZ3t_gOmZTB-C2WpLdWu45JZwQg@mail.gmail.com
Whole thread Raw
Responses Re: Index on a range array  (Daniel Cristian Cruz <danielcristian@gmail.com>)
Re: Index on a range array  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-performance
Hello,

I'm trying to simplify a schema, where I had many ranges floating around. My idea is to put them all in an array field and query like this:

SELECT
 event.*
FROM event
JOIN participant_details
 USING (participant_id)
WHERE
 tsrange(event.start, event.end) && ANY (participant_details.periods);

periods is tsrange[].

I've tryed and it worked, but without indexes. I've tried something, but didn't found anything... Does someone know how to index this kind of field (tsrange[])?

From the docs I learn that there is some GIST magic, but I would need to code in C. Is that true?

Regards,
--
Daniel Cristian Cruz
クルズ クリスチアン ダニエル

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Function execute slow down in 9.2
Next
From: Scott Marlowe
Date:
Subject: Re: subselect requires offset 0 for good performance.