Index not being used ?

Поиск
Список
Период
Сортировка
От Carlos G Mendioroz
Тема Index not being used ?
Дата
Msg-id 3F54964B.5070301@huapi.ba.ar
обсуждение исходный текст
Ответы Re: Index not being used ?  (Adam Kavan <akavan@cox.net>)
Re: Index not being used ?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список 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 по дате отправления:

Предыдущее
От: Jacob Hanson
Дата:
Сообщение: Re: delivering database stand-alone
Следующее
От: Malcolm Warren
Дата:
Сообщение: Use of oids