Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E234613A5D81 for ; Thu, 2 Aug 2012 17:13:24 -0300 (ADT) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sx1ln-0000Mk-Q0 for pgsql-performance@postgresql.org; Thu, 02 Aug 2012 20:13:23 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 02 Aug 2012 15:13:05 -0500 Message-Id: <501A98FD020000250004935D@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Thu, 02 Aug 2012 15:13:01 -0500 From: "Kevin Grittner" To: "Russell Keane" , "pgsql-performance@postgresql.org" Subject: Re: query using incorrect index References: <8D0E5D045E36124A8F1DDDB463D548557CEF4D2F7D@mxsvr1.is.inps.co.uk> In-Reply-To: <8D0E5D045E36124A8F1DDDB463D548557CEF4D2F7D@mxsvr1.is.inps.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201208/5 X-Sequence-Number: 47543 Russell Keane wrote: > Clearly the statistics are off somehow but I really don't know > where to start. > > Any help you can give me would be very much appreciated. It would help to know your more about your hardware and PostgreSQL configuration. The latter can probably best be communicated by copy/paste of the results of the query on this page: http://wiki.postgresql.org/wiki/Server_Configuration Can you also post the EXPLAIN ANALYZE output for the slow query with both indexes present but without the LIMIT clause? -Kevin