1. 08 Sep, 2011 5 commits
  2. 07 Sep, 2011 12 commits
  3. 06 Sep, 2011 13 commits
  4. 05 Sep, 2011 7 commits
  5. 04 Sep, 2011 3 commits
    • Tom Lane's avatar
      Change get_variable_numdistinct's API to flag default estimates explicitly. · 4c2777d0
      Tom Lane authored
      Formerly, callers tested for DEFAULT_NUM_DISTINCT, which had the problem
      that a perfectly solid estimate might be mistaken for a content-free
      default.
      4c2777d0
    • Tom Lane's avatar
      Dig down into sub-selects to look for column statistics. · 1cb108ef
      Tom Lane authored
      If a sub-select's output column is a simple Var, recursively look for
      statistics applying to that Var, and use them if available.  The need for
      this was foreseen ages ago, but we didn't have enough infrastructure to do
      it with reasonable speed until just now.
      
      We punt and stick with default estimates if the subquery uses set
      operations, GROUP BY, or DISTINCT, since those operations would change the
      underlying column statistics (particularly, the relative frequencies of
      different values) beyond recognition.  This means that the types of
      sub-selects for which this improvement applies are fairly limited, since
      most subqueries satisfying those restrictions would have gotten flattened
      into the parent query anyway.  But it does help for some cases, such as
      subqueries with ORDER BY or LIMIT.
      1cb108ef
    • Tom Lane's avatar
      Can't print PlannerGlobal's subroots list in outfuncs. · 698df335
      Tom Lane authored
      Since the subroots will surely link back to the same glob struct, this
      necessarily leads to infinite recursion.  Doh.  Found while trying to
      debug some other code.
      698df335