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 548543A6829 for ; Mon, 13 Dec 2004 02:49:06 +0000 (GMT) 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 27252-07 for ; Mon, 13 Dec 2004 02:48:57 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id DDF133A6844 for ; Mon, 13 Dec 2004 02:48:59 +0000 (GMT) Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6779046; Sun, 12 Dec 2004 18:50:33 -0800 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: Query is not using index when it should Date: Sun, 12 Dec 2004 18:48:27 -0800 User-Agent: KMail/1.6.2 Cc: tomas@nocrew.org (Tomas =?iso-8859-1?q?Sk=E4re?=) References: <80oeh2tm7x.fsf@junk.nocrew.org> In-Reply-To: <80oeh2tm7x.fsf@junk.nocrew.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200412121848.27513.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/154 X-Sequence-Number: 9529 Tomas, > I tried to subscribe to pgsql-performance, but there seems to be > something wrong with the majordomo, so I'm sending to general too, > where I'm already subscribed. Well, I got your e-mail, so obviously you're subscribed to Performance. > But when doing a search with objectid, class and field, it doesn't use > the idx_cjm_object1 index. > db=# explain analyze select * from cjm_object where objectid=4534 and > class=12 and field='paroid'; QUERY PLAN Try: explain analyze select * from cjm_object where objectid=4534::BIGINT and class=12 and field='paroid'; Sometimes the planner needs a little extra help on BIGINT fields. This problem is fixed in 8.0. -- Josh Berkus Aglio Database Solutions San Francisco