Re: cube_contains and indexing - Mailing list pgsql-general

From Tom Lane
Subject Re: cube_contains and indexing
Date
Msg-id 24268.1029689919@sss.pgh.pa.us
Whole thread Raw
In response to Re: cube_contains and indexing  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: cube_contains and indexing  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
Bruno Wolff III <bruno@wolff.to> writes:
>> It says here (cube.sql.in) that the @ operator *is* cube_contains.

> A short example is:
> cube=> explain select col1 from c where cube_contains('(-78,39),(-77,40)',col1);NOTICE:  QUERY PLAN:

> Seq Scan on c  (cost=0.00..369.30 rows=6195 width=24)

> EXPLAIN
> cube=> explain select col1 from c where '(-78,39),(-77,40)' @ col1;
> NOTICE:  QUERY PLAN:

> Index Scan using c_index on c  (cost=0.00..71.87 rows=19 width=24)

Well, yeah.  Indexes work with operators, not with functions.  This is
a consequence of decisions taken a decade ago at Berkeley: the system
catalogs that show what indexes can do connect *operators* to indexes,
not functions to indexes.  Use the operator.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: pg_query & pg_last_oid
Next
From: Bruno Wolff III
Date:
Subject: Re: cube_contains and indexing