Re: cube_contains and indexing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: cube_contains and indexing
Date: 2002-08-18 16:58:39
Message-ID: 24268.1029689919@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III <bruno(at)wolff(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-08-18 17:36:49 Re: cube_contains and indexing
Previous Message Martijn van Oosterhout 2002-08-18 13:16:03 Re: pg_query & pg_last_oid