X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0FED35E46D5 for ; Tue, 17 Aug 2004 12:45:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33374-06 for ; Tue, 17 Aug 2004 15:45:26 +0000 (GMT) Received: from mx.mall.cz (mx.mall.cz [62.168.45.106]) by svr1.postgresql.org (Postfix) with ESMTP id 16E385E46F0 for ; Tue, 17 Aug 2004 12:45:16 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx.mall.cz (Postfix) with ESMTP id 6E8F948026; Tue, 17 Aug 2004 17:45:22 +0200 (CEST) Received: from mx.mall.cz ([127.0.0.1]) by localhost (posta [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04713-01; Tue, 17 Aug 2004 17:45:12 +0200 (CEST) Message-ID: <4122281E.1060402@taborsky.cz> Date: Tue, 17 Aug 2004 17:45:34 +0200 From: Michal Taborsky User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Artimenko Igor Cc: pgsql-performance@postgresql.org Subject: Re: Postgres does not utilize indexes. Why? References: <20040817153555.85408.qmail@web11901.mail.yahoo.com> In-Reply-To: <20040817153555.85408.qmail@web11901.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/259 X-Sequence-Number: 7895 Artimenko Igor wrote: > id int8 NOT NULL DEFAULT nextval('next_id_seq'::text) INIQUE, ID column is bigint, but '50000' is int, therefore the index does not match. You need to cast your clause like this: select id from test where id = 50000::int8 Also, issue VACUUM ANALYZE, so Postgres knows about the structure of the data. -- Michal Taborsky http://www.taborsky.cz