Index not being used ? - Mailing list pgsql-general

From Carlos G Mendioroz
Subject Index not being used ?
Date
Msg-id 3F54964B.5070301@huapi.ba.ar
Whole thread Raw
Responses Re: Index not being used ?
Re: Index not being used ?
List pgsql-general
Hi,
I'm trying to understand why a perfect match index is not being used,
and a sequence scan is done in place:

PostgreSQL 7.3.4 on i686-pc-cygwin, compiled by GCC gcc (GCC) 3.2
20020927 (prerelease)

I've a table with 7M records, and an index on 3 fields:

CREATE TABLE public.base (
   nombre varchar(255),
   calle varchar(255),
   puerta int2,
   resto varchar(255),
   lid int2,
   area varchar(4),
   telefono varchar(10)
)
CREATE INDEX base_dir ON base USING btree (lid, calle, puerta);

And trying the following select:

select * from base where lid = 457 and calle = 'MALABIA' and puerta = 10

yields

Seq Scan on base  (cost=100000000.00..100212801.12 rows=1 width=63)
   Filter: ((lid = 457) AND (calle = 'MALABIA'::character varying) AND
(puerta = 10))

even with enable_seqscan set to off, as you may have guessed.

What am I missing here ?
(There's another index on area and telefono which works as expected,
so it's not a LOCALE problem AFAIK).

--
Carlos G Mendioroz  <tron@huapi.ba.ar>  LW7 EQI  Argentina


pgsql-general by date:

Previous
From: Jacob Hanson
Date:
Subject: Re: delivering database stand-alone
Next
From: Malcolm Warren
Date:
Subject: Use of oids