X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id F0592D1B53C for ; Mon, 8 Mar 2004 16:23:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42879-04 for ; Mon, 8 Mar 2004 12:23:04 -0400 (AST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id B243CD1D9E6 for ; Mon, 8 Mar 2004 12:23:03 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by bob.samurai.com (Postfix) with ESMTP id 929891E36; Mon, 8 Mar 2004 11:22:57 -0500 (EST) Received: from bob.samurai.com ([127.0.0.1]) by localhost (bob.samurai.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 84105-01-5; Mon, 8 Mar 2004 11:22:57 -0500 (EST) Received: from samurai.com (d226-89-59.home.cgocable.net [24.226.89.59]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bob.samurai.com (Postfix) with ESMTP id B23FD1D9D; Mon, 8 Mar 2004 11:22:56 -0500 (EST) Message-ID: <404C9DE0.7000200@samurai.com> Date: Mon, 08 Mar 2004 11:22:56 -0500 From: Neil Conway User-Agent: Mozilla Thunderbird 0.5 (X11/20040304) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Sullivan Cc: pgsql-performance@postgresql.org Subject: Re: Using bigint needs explicit cast to use the index References: <001101c404a3$fb34d320$fd08a8c0@steve> <20040308160525.GA25077@phlogiston.dyndns.org> In-Reply-To: <20040308160525.GA25077@phlogiston.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/99 X-Sequence-Number: 5955 Andrew Sullivan wrote: > "Intended", no. "Expected", yes. This topic has had the best > Postgres minds work on it, and so far nobody's come up with a > solution. Actually, this has already been fixed in CVS HEAD (as I mentioned in this thread yesterday). To wit: nconway=# create table t1 (a int8); CREATE TABLE nconway=# create index t1_a_idx on t1 (a); CREATE INDEX nconway=# explain select * from t1 where a = 5; QUERY PLAN -------------------------------------------------------------------- Index Scan using t1_a_idx on t1 (cost=0.00..17.07 rows=5 width=8) Index Cond: (a = 5) (2 rows) nconway=# select version(); version ------------------------------------------------------------------------------------ PostgreSQL 7.5devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (Debian) (1 row) -Neil