Re: PostGres is not using indices in select, I would like
От | Stephan Szabo |
---|---|
Тема | Re: PostGres is not using indices in select, I would like |
Дата | |
Msg-id | Pine.BSF.4.21.0109271442470.22313-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | PostGres is not using indices in select, I would like it to because it is too slow ! (Dominique Dumortier <dominique.dumortier@entpe.fr>) |
Список | pgsql-general |
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.
В списке pgsql-general по дате отправления: