pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Hoffmann <jeff@propertykey.com>
To: Julian Scarfe <julian@avbrief.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: RTREE on points
Date: Mon, 16 Apr 2001 09:18:32 -0500
Message-ID: <3ADAFF38.E7147C8D@propertykey.com> (raw)
References: <9bbtqv$688$1@news.tht.net>

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



view thread (13+ messages)  latest in thread

Message-ID: <3ADAFF38.E7147C8D@propertykey.com>
Permalink:  ../3ADAFF38.E7147C8D@propertykey.com/
Also on:    postgresql.org/message-id/3ADAFF38.E7147C8D@propertykey.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: jeff@propertykey.com, julian@avbrief.com
  Subject: Re: RTREE on points
  In-Reply-To: <3ADAFF38.E7147C8D@propertykey.com>
  References: <9bbtqv$688$1@news.tht.net> <3ADAFF38.E7147C8D@propertykey.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox