On Mon, 24 Sep 2001, Dominique Dumortier wrote:
> The table is created this way:
>
> CREATE TABLE "city" (
> "ciname" character varying(80),
> "cix" smallint,
> "ciy" smallint,
> "cilat" smallint,
> "cilong" smallint,
> "cialt" smallint,
> "cicocode" smallint,
> "cimacode" character(1),
> "cictcode" character(1)
> );
>
> COPY "city" FROM stdin;
> Abat 1030 504 4233 1981 1130 8 H T
> Abate 1030 504 4233 1981 1130 8 H T
> Abati 1030 504 4233 1981 1130 8 H T
> The table contains about 750000 lines such as the ones above.
>
>
> The index is created like that:
>
> CREATE INDEX ci_index on city (cix,ciy)
>
> If I do select ciname from city where cix=400 and ciy=500;
Ah, you're probably running into the integer constants being int4
problem. I'd suggest making the smallints into regular ints, or
explicitly casting the constants to smallint.