X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5C5FED1B570 for ; Wed, 8 Oct 2003 04:16:48 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66736-07 for ; Wed, 8 Oct 2003 01:16:02 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id A751AD1B57F for ; Wed, 8 Oct 2003 01:16:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h984Fvhn029372; Wed, 8 Oct 2003 00:15:58 -0400 (EDT) To: josh@agliodbs.com Cc: Oleg Lebedev , pgsql-performance@postgresql.org Subject: Re: TPC-R benchmarks In-reply-to: <200310071659.17863.josh@agliodbs.com> References: <993DBE5B4D02194382EC8DF8554A52731D7661@postoffice.waterford.org> <200310071659.17863.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Tue, 07 Oct 2003 16:59:17 -0700" Date: Wed, 08 Oct 2003 00:15:57 -0400 Message-ID: <29371.1065586557@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/196 X-Sequence-Number: 3944 Josh Berkus writes: > To sum up the below: it appears that whenever a set of WHERE conditions > exceeds a certain level of complexity, the planner just ignores all > applicable indexes and goes for a seq scan. It looks to me like the planner is coercing the WHERE clause into canonical OR-of-ANDs form (DNF). Which is often a good heuristic but it seems unhelpful for this query. > How can we fix this? Feel free to propose improvements to the heuristics in src/backend/optimizer/prep/prepqual.c ... regards, tom lane