Use of indexes

Поиск
Список
Период
Сортировка
От Andre Schubert
Тема Use of indexes
Дата
Msg-id 3CC8FD41.DDE7B82E@km3.de
обсуждение исходный текст
Ответы Re: Use of indexes  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-sql
Hi all,

i have a litte problem using indexes with datatypes int and int8.

i have a table

test:id1 int,       id2 int8

if have to indexes:

index_test_1:
--------+---------id1    | integer
btree

index_test_2:
--------+--------id2    | bigint
btree

If i do any explains i got the following:

db_nmkm3=# explain select * from test where id1=1;
Index Scan using index_test_1 on test  (cost=0.00..3.01 rows=1 width=12)

db_nmkm3=# explain select * from test where id2=1;
Seq Scan on test  (cost=0.00..20.55 rows=1 width=12)

db_nmkm3=# explain select * from test where id2=1::int8;
Index Scan using index_test_2 on test  (cost=0.00..3.01 rows=1 width=12)

Can somebody explain me whats wrong with me or my indexes?

thanks in advance


В списке pgsql-sql по дате отправления:

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Database Server in Recovery mode!
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Use of indexes