X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 021EFD7D64 for ; Sat, 27 Aug 2005 13:42:53 -0300 (ADT) 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 70429-05 for ; Sat, 27 Aug 2005 16:42:49 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C4982D7DD6 for ; Sat, 27 Aug 2005 12:05:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7RF51gh001405; Sat, 27 Aug 2005 11:05:01 -0400 (EDT) To: "Steinar H. Gunderson" Cc: pgsql-performance@postgresql.org Subject: Re: Weird performance drop after VACUUM In-reply-to: <20050827101945.GA18155@uio.no> References: <1125093859.9329.30.camel@localhost.localdomain> <26745.1125099111@sss.pgh.pa.us> <20050827101945.GA18155@uio.no> Comments: In-reply-to "Steinar H. Gunderson" message dated "Sat, 27 Aug 2005 12:19:45 +0200" Date: Sat, 27 Aug 2005 11:05:01 -0400 Message-ID: <1404.1125155101@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/481 X-Sequence-Number: 14228 "Steinar H. Gunderson" writes: > On Fri, Aug 26, 2005 at 07:31:51PM -0400, Tom Lane wrote: >> Or you could just play with the order of the filter conditions ... for >> example, the date condition at the end is probably far cheaper to test >> than the text comparisons, so if that's fairly selective it'd be worth >> putting it first. > That's an interesting approach -- could the planner do such things itself? It could, but it doesn't really have enough information. We don't currently have any model that some operators are more expensive than others. IIRC the only sort of reordering the current code will do in a filter condition list is to push clauses involving sub-SELECTs to the end. regards, tom lane