Julian Scarfe wrote:
> 
> explain select * from nodes where box(node,node) @ '((1,1),(3,3))'::box;
> NOTICE:  QUERY PLAN:
> Seq Scan on nodes  (cost=0.00..1.10 rows=1 width=28)
> 

this should work, assuming you have enough points to make a difference
(in the optimizer's mind, at least).  the optimizer still doesn't do a
great job of knowing when it's best to use an index, although, in your
sample, there's no way it would ever be cheaper to use an index. 
there's simply not enough data there.  you can test to see if an index
can be used by a query by shutting off the sequential scans (set
enable_seqscan=off) and retrying the query.  essentially, this forces it
to use an index scan if at all possible.

-- 

Jeff Hoffmann
PropertyKey.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to