Re: Index not being used ? - Mailing list pgsql-general

From Adam Kavan
Subject Re: Index not being used ?
Date
Msg-id 5.2.1.1.0.20030903163241.00a58a50@pop.central.cox.net
Whole thread Raw
In response to Index not being used ?  (Carlos G Mendioroz <tron@huapi.ba.ar>)
Responses Re: Index not being used ?
Re: Index not being used ?
List pgsql-general
>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

I think its because lid and puerta are int2's and 457 and 10 are
int4's.  Try lid = '457'::int2 and puerta = '10'::int2.  To use an index
the variables have to match types exactly.

--- Adam Kavan
--- akavan@cox.net


pgsql-general by date:

Previous
From: "Gregory S. Williamson"
Date:
Subject: Re: setting last_value of sequence
Next
From: Josué Maldonado
Date:
Subject: Re: TCL trigger doesn't work after deleting a column