From: Andre Schubert <andre.schubert@km3.de>
To: pgsql-sql@postgresql.org
Subject: Use of indexes
Date: Fri, 26 Apr 2002 09:09:53 +0200
Message-ID: <3CC8FD41.DDE7B82E@km3.de> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: andre.schubert@km3.de
Subject: Re: Use of indexes
In-Reply-To: <3CC8FD41.DDE7B82E@km3.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox