Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 11596635160 for ; Thu, 26 Mar 2009 11:47:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 45146-05 for ; Thu, 26 Mar 2009 11:47:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id BAEDE634A04 for ; Thu, 26 Mar 2009 11:47:41 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Thu, 26 Mar 2009 09:47:39 -0500 Message-Id: <49CB4F35.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Thu, 26 Mar 2009 09:47:33 -0500 From: "Kevin Grittner" To: "Matthew Wakeling" , Subject: Re: Very specialised query References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200903/383 X-Sequence-Number: 33305 Matthew Wakeling wrote: > any other tips? I would try adding an index on (objectid, start) and another on (objectid, end) and see how that first query does. Also, if id is a unique identifier, I'd recommend a unique constraint or (better) a primary key definition. Check the system tables to see whether all the existing indexes are actually being used -- if not, drop them. -Kevin