R-tree index - Mailing list pgsql-general

From Michel Nadeau
Subject R-tree index
Date
Msg-id 3A01888B.6FB75EA2@korem.com
Whole thread Raw
List pgsql-general
Hi,

We created a database with some boxes in it. We make spatail queries on
the boxes. like:
SELECT openMapIndex
FROM tableName
WHERE BBOX::box && '((-73,45),(-74,46))';

The query is working fine. We indexed the field BBOX.  It takes about 17
seconds when doing a sequential search and 0.5 second when doing an
indexed scan. Here is our problem. Postgresql does not by default use
the index, which is strange given the benefits of it. When we do the
EXPLAIN command, it says that it will do a sequential search. The only
way we found for it to use the index is to set the "ENABLE_SEQSCAN"
variable to "OFF". But that just work for one session. We are connecting
remotely to the database throught JDBC and we do not find a way to force
the indexed scan.

Anybody has an idea of what we are doing wrong?

Thanks
--
_______________________________________

Michel Nadeau  /  mn@korem.com
Programmeur-Analyste

Le Groupe KOREM inc.
Connaître et gérer son territoire / La géomatique
au service des technologies de l'information.

680, boulevard Charest Est, 1er étage
Québec (Québec)    G1K 3J4
tél. : (418) 647-1555  fax  : (418) 647-1666
http : //www.korem.com
_________________________________________



pgsql-general by date:

Previous
From: Justin Foster
Date:
Subject: Memory Leak
Next
From: Tom Lane
Date:
Subject: Re: set digest