X-Original-To: pgsql-hackers@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 32E27476394; Tue, 6 May 2003 00:45:27 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 70D72476363; Tue, 6 May 2003 00:45:26 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h464jUU6022401; Tue, 6 May 2003 00:45:31 -0400 (EDT) To: Josh Berkus Cc: pgsql-performance , pgsql-hackers@postgresql.org Subject: Re: Hypothetical suggestions for planner, indexing improvement In-reply-to: <200305052133.33680.josh@agliodbs.com> References: <200305051219.58955.josh@agliodbs.com> <22292.1052195133@sss.pgh.pa.us> <200305052133.33680.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 05 May 2003 21:33:33 -0700" Date: Tue, 06 May 2003 00:45:30 -0400 Message-ID: <22400.1052196330@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/95 X-Sequence-Number: 38602 Josh Berkus writes: > The reason that I mention EXISTS is because that's where the lack of > cross-column corellation is most dramatic; the planner seems to estimate a > flat 50% for EXISTS clauses regardless of the content. No "seems to" about that one: see src/backend/optimizer/path/clausesel.c else if (is_subplan(clause)) { /* * Just for the moment! FIX ME! - vadim 02/04/98 */ s1 = (Selectivity) 0.5; } Patches to improve this are welcome ;-). But I'm not at all sure how to write something that would extract a reliable selectivity estimate from a subplan. regards, tom lane