1. 14 Jan, 2006 1 commit
  2. 10 Jan, 2006 1 commit
    • Tom Lane's avatar
      Improve patternsel() by applying the operator itself to each value · ce8fd39e
      Tom Lane authored
      listed in the column's most-common-values statistics entry.  This gives
      us an exact selectivity result for the portion of the column population
      represented by the MCV list, which can be a big leg up in accuracy if
      that's a large fraction of the population.  The heuristics involving
      pattern contents and prefix are applied only to the part of the population
      not included in the MCV list.
      ce8fd39e
  3. 25 Nov, 2005 1 commit
    • Tom Lane's avatar
      Teach planner and executor to handle ScalarArrayOpExpr as an indexable · 290166f9
      Tom Lane authored
      qualification when the underlying operator is indexable and useOr is true.
      That is, indexkey op ANY (ARRAY[...]) is effectively translated into an
      OR combination of one indexscan for each array element.  This only works
      for bitmap index scans, of course, since regular indexscans no longer
      support OR'ing of scans.  There are still some loose ends to clean up
      before changing 'x IN (list)' to translate as a ScalarArrayOpExpr;
      for instance predtest.c ought to be taught about it.  But this gets the
      basic functionality in place.
      290166f9
  4. 22 Nov, 2005 1 commit
  5. 07 Nov, 2005 1 commit
  6. 15 Oct, 2005 1 commit
  7. 11 Oct, 2005 1 commit
    • Tom Lane's avatar
      Document that get_attstatsslot/free_attstatsslot only need to be passed · 0cc0d082
      Tom Lane authored
      valid type information if they are asked to fetch the values part of a
      pg_statistic slot; these arguments are unneeded if fetching only the
      numbers part.  Use this to save a catcache lookup in btcostestimate,
      which is looking like a bit of a hotspot in recent profiling.  Not a
      big savings, but since it's essentially free, might as well do it.
      0cc0d082
  8. 24 Sep, 2005 2 commits
  9. 21 Jul, 2005 2 commits
  10. 20 Jul, 2005 1 commit
    • Bruce Momjian's avatar
      Add 'day' field to INTERVAL so 1 day interval can be distinguished from · db05f4a7
      Bruce Momjian authored
      24 hours. This is very helpful for daylight savings time:
      
      	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '24 hours';
      	      ?column?
      	----------------------
      	2005-05-04 01:00:00-04
      
      	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '1 day';
      	      ?column?
      	----------------------
      	2005-05-04 01:00:00-04
      
      Michael Glaesemann
      db05f4a7
  11. 12 Jul, 2005 1 commit
  12. 29 Jun, 2005 1 commit
    • Tom Lane's avatar
      Clean up the rather historically encumbered interface to now() and · b5f7cff8
      Tom Lane authored
      current time: provide a GetCurrentTimestamp() function that returns
      current time in the form of a TimestampTz, instead of separate time_t
      and microseconds fields.  This is what all the callers really want
      anyway, and it eliminates low-level dependencies on AbsoluteTime,
      which is a deprecated datatype that will have to disappear eventually.
      b5f7cff8
  13. 13 Jun, 2005 1 commit
    • Tom Lane's avatar
      Change the planner to allow indexscan qualification clauses to use · c186c931
      Tom Lane authored
      nonconsecutive columns of a multicolumn index, as per discussion around
      mid-May (pghackers thread "Best way to scan on-disk bitmaps").  This
      turns out to require only minimal changes in btree, and so far as I can
      see none at all in GiST.  btcostestimate did need some work, but its
      original assumption that index selectivity == heap selectivity was
      quite bogus even before this.
      c186c931
  14. 10 Jun, 2005 1 commit
  15. 05 Jun, 2005 1 commit
    • Tom Lane's avatar
      Remove planner's private fields from Query struct, and put them into · 9ab4d981
      Tom Lane authored
      a new PlannerInfo struct, which is passed around instead of the bare
      Query in all the planning code.  This commit is essentially just a
      code-beautification exercise, but it does open the door to making
      larger changes to the planner data structures without having to muck
      with the widely-known Query struct.
      9ab4d981
  16. 01 Jun, 2005 1 commit
  17. 25 Apr, 2005 1 commit
    • Tom Lane's avatar
      Remove support for OR'd indexscans internal to a single IndexScan plan · 5b051852
      Tom Lane authored
      node, as this behavior is now better done as a bitmap OR indexscan.
      This allows considerable simplification in nodeIndexscan.c itself as
      well as several planner modules concerned with indexscan plan generation.
      Also we can improve the sharing of code between regular and bitmap
      indexscans, since they are now working with nigh-identical Plan nodes.
      5b051852
  18. 14 Apr, 2005 1 commit
  19. 01 Apr, 2005 1 commit
  20. 27 Mar, 2005 1 commit
    • Tom Lane's avatar
      First steps towards index scans with heap access decoupled from index · bf3dbb58
      Tom Lane authored
      access: define new index access method functions 'amgetmulti' that can
      fetch multiple TIDs per call.  (The functions exist but are totally
      untested as yet.)  Since I was modifying pg_am anyway, remove the
      no-longer-needed 'rel' parameter from amcostestimate functions, and
      also remove the vestigial amowner column that was creating useless
      work for Alvaro's shared-object-dependencies project.
      Initdb forced due to changes in pg_am.
      bf3dbb58
  21. 26 Mar, 2005 1 commit
    • Tom Lane's avatar
      Fix a pair of related issues with estimation of inequalities that involve · 9d388e1f
      Tom Lane authored
      binary-compatible relabeling of one or both operands.  examine_variable
      should avoid stripping RelabelType from non-variable expressions, so that
      they will continue to have the correct type; and convert_to_scalar should
      just use that type and ignore the other input type.  This isn't perfect
      but it beats failing entirely.  Per example from Michael Fuhr.
      9d388e1f
  22. 07 Mar, 2005 1 commit
  23. 06 Mar, 2005 1 commit
  24. 01 Feb, 2005 1 commit
  25. 28 Jan, 2005 1 commit
    • Tom Lane's avatar
      When dealing with multiple grouping columns coming from the same table, · 875b0c62
      Tom Lane authored
      clamp the estimated number of groups to table row count over 10, instead
      of table row count; this reflects a heuristic that people probably won't
      group over a near-unique set of columns, and the knowledge that we don't
      currently have any way to estimate the correlation of the columns better
      than guessing.  This change creates a trivial plan change in one of the
      regression tests.
      875b0c62
  26. 31 Dec, 2004 1 commit
    • PostgreSQL Daemon's avatar
      · 2ff50159
      PostgreSQL Daemon authored
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  27. 02 Dec, 2004 1 commit
  28. 09 Nov, 2004 1 commit
    • Tom Lane's avatar
      Use a hopefully-more-reliable method of detecting default selectivity · 547bb4a7
      Tom Lane authored
      estimates when combining the estimates for a range query.  As pointed out
      by Miquel van Smoorenburg, the existing check for an impossible combined
      result would quite possibly fail to detect one default and one non-default
      input.  It seems better to use the default range query estimate in such
      cases.  To do so, add a check for an estimate of exactly DEFAULT_INEQ_SEL.
      This is a bit ugly because it introduces additional coupling between
      clauselist_selectivity and scalarltsel/scalargtsel, but it's not like
      there wasn't plenty already...
      547bb4a7
  29. 18 Sep, 2004 1 commit
  30. 30 Aug, 2004 1 commit
  31. 29 Aug, 2004 2 commits
  32. 04 Aug, 2004 1 commit
  33. 11 Jun, 2004 1 commit
    • Tom Lane's avatar
      When using extended-query protocol, postpone planning of unnamed statements · 7643bed5
      Tom Lane authored
      until Bind is received, so that actual parameter values are visible to the
      planner.  Make use of the parameter values for estimation purposes (but
      don't fold them into the actual plan).  This buys back most of the
      potential loss of plan quality that ensues from using out-of-line
      parameters instead of putting literal values right into the query text.
      
      This patch creates a notion of constant-folding expressions 'for
      estimation purposes only', in which case we can be more aggressive than
      the normal eval_const_expressions() logic can be.  Right now the only
      difference in behavior is inserting bound values for Params, but it will
      be interesting to look at other possibilities.  One that we've seen
      come up repeatedly is reducing now() and related functions to current
      values, so that queries like ... WHERE timestampcol > now() - '1 day'
      have some chance of being planned effectively.
      
      Oliver Jowett, with some kibitzing from Tom Lane.
      7643bed5
  34. 30 May, 2004 1 commit
  35. 26 May, 2004 1 commit
    • Neil Conway's avatar
      Reimplement the linked list data structure used throughout the backend. · d0b4399d
      Neil Conway authored
      In the past, we used a 'Lispy' linked list implementation: a "list" was
      merely a pointer to the head node of the list. The problem with that
      design is that it makes lappend() and length() linear time. This patch
      fixes that problem (and others) by maintaining a count of the list
      length and a pointer to the tail node along with each head node pointer.
      A "list" is now a pointer to a structure containing some meta-data
      about the list; the head and tail pointers in that structure refer
      to ListCell structures that maintain the actual linked list of nodes.
      
      The function names of the list API have also been changed to, I hope,
      be more logically consistent. By default, the old function names are
      still available; they will be disabled-by-default once the rest of
      the tree has been updated to use the new API names.
      d0b4399d
  36. 27 Feb, 2004 1 commit
  37. 17 Feb, 2004 1 commit
    • Tom Lane's avatar
      Make use of statistics on index expressions. There are still some · a536ed53
      Tom Lane authored
      corner cases that could stand improvement, but it does all the basic
      stuff.  A byproduct is that the selectivity routines are no longer
      constrained to working on simple Vars; we might in future be able to
      improve the behavior for subexpressions that don't match indexes.
      a536ed53