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 E1DFCD1B45B for ; Thu, 5 Feb 2004 17:31:33 +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 95231-04 for ; Thu, 5 Feb 2004 13:31:27 -0400 (AST) Received: from busybox.pixar.com (busybox.pixar.com [138.72.18.213]) by svr1.postgresql.org (Postfix) with ESMTP id 67B38D1D201 for ; Thu, 5 Feb 2004 13:31:26 -0400 (AST) Received: from pixar.com (dreadnok.pixar.com [138.72.16.110]) by busybox.pixar.com (8.12.8/8.12.8) with ESMTP id i15HVOHw025958; Thu, 5 Feb 2004 09:31:24 -0800 Message-ID: <40227DEC.5010007@pixar.com> Date: Thu, 05 Feb 2004 09:31:24 -0800 From: Mark Harrison User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Corey Edwards Cc: pgsql-performance@postgresql.org Subject: Re: select is not using index? References: <40217853.20309@pixar.com> <1075936942.12400.18.camel@harvey> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/77 X-Sequence-Number: 5601 Corey Edwards wrote: > Your column is a bigint but 123 defaults to type int. Indexes aren't > used when there's a type mismatch. Use an explicit cast or quote it: > > select * from bigtable where id = 123::bigint; > > Or > > select * from bigtable where id = '123'; Thanks Corey, both of these do exactly what I need... Cheers, Mark -- Mark Harrison Pixar Animation Studios