R-tree index

From: Michel Nadeau <mn(at)korem(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: R-tree index
Date: 2000-11-02 15:30:19
Message-ID: 3A01888B.6FB75EA2@korem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)korem(dot)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
_________________________________________

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-11-02 16:00:53 Re: set digest
Previous Message Lamar Owen 2000-11-02 15:28:21 Re: Re: [GENERAL] 7.0 vs. 7.1 (was: latest version?)