Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9B8F6634563 for ; Mon, 6 Jul 2009 15:26:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81870-10 for ; Mon, 6 Jul 2009 15:26:40 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id 1B27F634505 for ; Mon, 6 Jul 2009 15:26:40 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id 2B73175331E; Mon, 6 Jul 2009 18:26:39 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Fix set_append_rel_pathlist() to deal intelligently with cases X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090706182639.2B73175331E@cvs.postgresql.org> Date: Mon, 6 Jul 2009 18:26:39 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/68 X-Sequence-Number: 37671 Log Message: ----------- Fix set_append_rel_pathlist() to deal intelligently with cases where substituting a child rel's output expressions into the appendrel's restriction clauses yields a pseudoconstant restriction. We might be able to skip scanning that child rel entirely (if we get constant FALSE), or generate a one-time filter. 8.3 more or less accidentally generated plans that weren't completely stupid in these cases, but that was only because an extra recursive level of subquery_planner() always occurred and allowed const-simplification to happen. 8.4's ability to pull up appendrel members with non-Var outputs exposes the fact that we need to work harder here. Per gripe from Sergey Burladyan. Tags: ---- REL8_4_STABLE Modified Files: -------------- pgsql/src/backend/optimizer/path: allpaths.c (r1.183 -> r1.183.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/allpaths.c?r1=1.183&r2=1.183.2.1) pgsql/src/backend/optimizer/prep: prepunion.c (r1.171 -> r1.171.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.171&r2=1.171.2.1) pgsql/src/backend/optimizer/util: restrictinfo.c (r1.60 -> r1.60.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/restrictinfo.c?r1=1.60&r2=1.60.2.1) pgsql/src/include/optimizer: restrictinfo.h (r1.44 -> r1.44.2.1) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/restrictinfo.h?r1=1.44&r2=1.44.2.1)