Skip to content
Snippets Groups Projects
  1. Sep 03, 2007
  2. Sep 02, 2007
  3. Sep 01, 2007
    • Tom Lane's avatar
      Since sort_bounded_heap makes state changes that should be made · d2825e1c
      Tom Lane authored
      regardless of the number of tuples involved, it's incorrect to skip it
      when memtupcount = 1; the number of cycles saved is minuscule anyway.
      An alternative solution would be to pull the state changes out to the
      call site in tuplesort_performsort, but keeping them near the corresponding
      changes in make_bounded_heap seems marginally cleaner.  Noticed by
      Greg Stark.
      d2825e1c
    • Tom Lane's avatar
      Apply a band-aid fix for the problem that 8.2 and up completely misestimate · 0ee5a398
      Tom Lane authored
      the number of rows likely to be produced by a query such as
      	SELECT * FROM t1 LEFT JOIN t2 USING (key) WHERE t2.key IS NULL;
      What this is doing is selecting for t1 rows with no match in t2, and thus
      it may produce a significant number of rows even if the t2.key table column
      contains no nulls at all.  8.2 thinks the table column's null fraction is
      relevant and thus may estimate no rows out, which results in terrible plans
      if there are more joins above this one.  A proper fix for this will involve
      passing much more information about the context of a clause to the selectivity
      estimator functions than we ever have.  There's no time left to write such a
      patch for 8.3, and it wouldn't be back-patchable into 8.2 anyway.  Instead,
      put in an ad-hoc test to defeat the normal table-stats-based estimation when
      an IS NULL test is evaluated at an outer join, and just use a constant
      estimate instead --- I went with 0.5 for lack of a better idea.  This won't
      catch every case but it will catch the typical ways of writing such queries,
      and it seems unlikely to make things worse for other queries.
      0ee5a398
  4. Aug 31, 2007
  5. Aug 30, 2007
  6. Aug 29, 2007
  7. Aug 28, 2007
Loading