Re: index on a box - Mailing list pgsql-general

From Tom Lane
Subject Re: index on a box
Date
Msg-id 22953.993162379@sss.pgh.pa.us
Whole thread Raw
In response to index on a box  (Dustin Sallings <dustin@spy.net>)
Responses Re: index on a box  (Dustin Sallings <dustin+postgres@spy.net>)
List pgsql-general
Dustin Sallings <dustin+postgres@spy.net> writes:
> create function box(point) returns box as
>     'select box($1, $1)'
>     language 'sql';

> misc=# explain select * from tmp where box(point(-121, 37)) @ b;
> NOTICE:  QUERY PLAN:

> Seq Scan on tmp  (cost=0.00..2653.01 rows=61 width=92)

You'd better declare the function as 'iscachable'.  As is, the planner
doesn't trust it to return a constant.

            regards, tom lane

pgsql-general by date:

Previous
From: Dustin Sallings
Date:
Subject: Re: index on a box
Next
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: postgres 7.0.3 with SuSE 7.1