1. 01 Jul, 2006 2 commits
    • Tom Lane's avatar
      Fix oversight in planning for multiple indexscans driven by · 08ccdf02
      Tom Lane authored
      ScalarArrayOpExpr index quals: we were estimating the right total
      number of rows returned, but treating the index-access part of the
      cost as if a single scan were fetching that many consecutive index
      tuples.  Actually we should treat it as a multiple indexscan, and
      if there are enough of 'em the Mackert-Lohman discount should kick in.
      08ccdf02
    • Tom Lane's avatar
      Revise the planner's handling of "pseudoconstant" WHERE clauses, that is · cffd89ca
      Tom Lane authored
      clauses containing no variables and no volatile functions.  Such a clause
      can be used as a one-time qual in a gating Result plan node, to suppress
      plan execution entirely when it is false.  Even when the clause is true,
      putting it in a gating node wins by avoiding repeated evaluation of the
      clause.  In previous PG releases, query_planner() would do this for
      pseudoconstant clauses appearing at the top level of the jointree, but
      there was no ability to generate a gating Result deeper in the plan tree.
      To fix it, get rid of the special case in query_planner(), and instead
      process pseudoconstant clauses through the normal RestrictInfo qual
      distribution mechanism.  When a pseudoconstant clause is found attached to
      a path node in create_plan(), pull it out and generate a gating Result at
      that point.  This requires special-casing pseudoconstants in selectivity
      estimation and cost_qual_eval, but on the whole it's pretty clean.
      It probably even makes the planner a bit faster than before for the normal
      case of no pseudoconstants, since removing pull_constant_clauses saves one
      useless traversal of the qual tree.  Per gripe from Phil Frost.
      cffd89ca
  2. 30 Jun, 2006 3 commits
  3. 29 Jun, 2006 4 commits
  4. 28 Jun, 2006 11 commits
  5. 27 Jun, 2006 18 commits
  6. 26 Jun, 2006 2 commits