Skip to content

Instantly share code, notes, and snippets.

@choplin
Created June 7, 2011 15:26
Show Gist options
  • Save choplin/1012473 to your computer and use it in GitHub Desktop.
Save choplin/1012473 to your computer and use it in GitHub Desktop.
CREATE TABLE t (
id int
,p cube
);
CREATE INDEX _idx_p ON t USING gist (p);
INSERT INTO t VALUES (1, '(1,2,3)');
EXPLAIN SELECT * FROM t WHERE p <@ '(0,0,0),(3,3,3)';
//"Index Scan using _idx_p on t (cost=0.00..8.27 rows=1 width=36)"
//" Index Cond: (p <@ '(0, 0, 0),(3, 3, 3)'::cube)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment