Skip site navigation (1) Skip section navigation (2)

Re: BUG #4810: Complex Contains, Bad Performace.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul Mathews" <plm(at)netspace(dot)net(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4810: Complex Contains, Bad Performace.
Date: 2009-05-15 14:03:41
Message-ID: 2470.1242396221@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Paul Mathews" <plm(at)netspace(dot)net(dot)au> writes:
> Despite the existence of the index, postgresql is determined to full table
> scan when given.
>   SELECT 
>     postcode
>   WHERE
>     boundary @> point 'x,y';

polygon @> point isn't an indexable operator.  The indexable operators
for a gist index on polygon are

 <<(polygon,polygon)
 &<(polygon,polygon)
 &&(polygon,polygon)
 &>(polygon,polygon)
 >>(polygon,polygon)
 ~=(polygon,polygon)
 @>(polygon,polygon)
 <@(polygon,polygon)
 &<|(polygon,polygon)
 <<|(polygon,polygon)
 |>>(polygon,polygon)
 |&>(polygon,polygon)
 ~(polygon,polygon)
 @(polygon,polygon)

So it looks like you need to convert the point to a one-point polygon.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Simon RiggsDate: 2009-05-15 14:10:42
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Previous:From: Fujii MasaoDate: 2009-05-15 13:56:15
Subject: Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group