1. 23 10月, 2008 3 次提交
    • P
    • T
      When estimating without benefit of MCV lists (suggesting that one or both · 7f3eba30
      Tom Lane 提交于
      inputs is unique or nearly so), make eqjoinsel() clamp the ndistinct estimates
      to be not more than the estimated number of rows coming from the input
      relations.  This allows the estimate to change in response to the selectivity
      of restriction conditions on the inputs.
      
      This is a pretty narrow patch and maybe we should be more aggressive about
      similarly clamping ndistinct in other cases; but I'm worried about
      double-counting the effects of the restriction conditions.  However, it seems
      to help for the case exhibited by Grzegorz Jaskiewicz (antijoin against a
      small subset of a relation), so let's try this for awhile.
      7f3eba30
    • T
      Dept of better ideas: refrain from creating the planner's placeholder_list · 31468d05
      Tom Lane 提交于
      until vars are distributed to rels during query_planner() startup.  We don't
      really need it before that, and not building it early has some advantages.
      First, we don't need to put it through the various preprocessing steps, which
      saves some cycles and eliminates the need for a number of routines to support
      PlaceHolderInfo nodes at all.  Second, this means one less unused plan for any
      sub-SELECT appearing in a placeholder's expression, since we don't build
      placeholder_list until after sublink expansion is complete.
      31468d05
  2. 22 10月, 2008 3 次提交
    • T
      Fix GiST's killing tuple: GISTScanOpaque->curpos wasn't · b9856b67
      Teodor Sigaev 提交于
      correctly set. As result, killtuple() marks as dead
      wrong tuple on page. Bug was introduced by me while fixing
      possible duplicates during GiST index scan.
      b9856b67
    • P
      SQL:2008 alternative syntax for LIMIT/OFFSET: · 361bfc35
      Peter Eisentraut 提交于
      OFFSET num {ROW|ROWS} FETCH {FIRST|NEXT} [num] {ROW|ROWS} ONLY
      361bfc35
    • T
      Add a concept of "placeholder" variables to the planner. These are variables · e6ae3b5d
      Tom Lane 提交于
      that represent some expression that we desire to compute below the top level
      of the plan, and then let that value "bubble up" as though it were a plain
      Var (ie, a column value).
      
      The immediate application is to allow sub-selects to be flattened even when
      they are below an outer join and have non-nullable output expressions.
      Formerly we couldn't flatten because such an expression wouldn't properly
      go to NULL when evaluated above the outer join.  Now, we wrap it in a
      PlaceHolderVar and arrange for the actual evaluation to occur below the outer
      join.  When the resulting Var bubbles up through the join, it will be set to
      NULL if necessary, yielding the correct results.  This fixes a planner
      limitation that's existed since 7.1.
      
      In future we might want to use this mechanism to re-introduce some form of
      Hellerstein's "expensive functions" optimization, ie place the evaluation of
      an expensive function at the most suitable point in the plan tree.
      e6ae3b5d
  3. 21 10月, 2008 7 次提交
  4. 20 10月, 2008 6 次提交
  5. 18 10月, 2008 11 次提交
  6. 17 10月, 2008 1 次提交
  7. 16 10月, 2008 2 次提交
    • T
      Reduce chatter from _dosmaperr() when used in FRONTEND code. · 0e3d5ad4
      Tom Lane 提交于
      ITAGAKI Takahiro
      0e3d5ad4
    • T
      Fix SPI_getvalue and SPI_getbinval to range-check the given attribute number · bcf188a2
      Tom Lane 提交于
      according to the TupleDesc's natts, not the number of physical columns in the
      tuple.  The previous coding would do the wrong thing in cases where natts is
      different from the tuple's column count: either incorrectly report error when
      it should just treat the column as null, or actually crash due to indexing off
      the end of the TupleDesc's attribute array.  (The second case is probably not
      possible in modern PG versions, due to more careful handling of inheritance
      cases than we once had.  But it's still a clear lack of robustness here.)
      
      The incorrect error indication is ignored by all callers within the core PG
      distribution, so this bug has no symptoms visible within the core code, but
      it might well be an issue for add-on packages.  So patch all the way back.
      bcf188a2
  8. 15 10月, 2008 5 次提交
  9. 14 10月, 2008 2 次提交