1. 21 Feb, 2005 1 commit
  2. 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
  3. 01 Dec, 2004 1 commit
    • Tom Lane's avatar
      Change planner to use the current true disk file size as its estimate of · 5374d097
      Tom Lane authored
      a relation's number of blocks, rather than the possibly-obsolete value
      in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
      to arrive at a hopefully more accurate number of rows.  When pg_class
      contains 0/0, estimate a tuple width from the column datatypes and divide
      that into current file size to estimate number of rows.  This improved
      methodology allows us to jettison the ancient hacks that put bogus default
      values into pg_class when a table is first created.  Also, per a suggestion
      from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
      it puts into pg_class.reltuples to try to represent the mean tuple density
      instead of the minimal density that actually prevails just after VACUUM.
      These changes alter the plans selected for certain regression tests, so
      update the expected files accordingly.  (I removed join_1.out because
      it's not clear if it still applies; we can add back any variant versions
      as they are shown to be needed.)
      5374d097
  4. 26 Nov, 2004 1 commit
  5. 29 Aug, 2004 2 commits
  6. 04 Aug, 2004 1 commit
  7. 05 Jun, 2004 1 commit
    • Tom Lane's avatar
      Make the world very nearly safe for composite-type columns in tables. · ae93e5fd
      Tom Lane authored
      1. Solve the problem of not having TOAST references hiding inside composite
      values by establishing the rule that toasting only goes one level deep:
      a tuple can contain toasted fields, but a composite-type datum that is
      to be inserted into a tuple cannot.  Enforcing this in heap_formtuple
      is relatively cheap and it avoids a large increase in the cost of running
      the tuptoaster during final storage of a row.
      2. Fix some interesting problems in expansion of inherited queries that
      reference whole-row variables.  We never really did this correctly before,
      but it's now relatively painless to solve by expanding the parent's
      whole-row Var into a RowExpr() selecting the proper columns from the
      child.
      If you dike out the preventive check in CheckAttributeType(),
      composite-type columns now seem to actually work.  However, we surely
      cannot ship them like this --- without I/O for composite types, you
      can't get pg_dump to dump tables containing them.  So a little more
      work still to do.
      ae93e5fd
  8. 01 Jun, 2004 1 commit
  9. 25 Apr, 2004 1 commit
  10. 05 Jan, 2004 3 commits
    • Tom Lane's avatar
      Adjust indexscan planning logic to keep RestrictInfo nodes associated · fa559a86
      Tom Lane authored
      with index qual clauses in the Path representation.  This saves a little
      work during createplan and (probably more importantly) allows reuse of
      cached selectivity estimates during indexscan planning.  Also fix latent
      bug: wrong plan would have been generated for a 'special operator' used
      in a nestloop-inner-indexscan join qual, because the special operator
      would not have gotten into the list of quals to recheck.  This bug is
      only latent because at present the special-operator code could never
      trigger on a join qual, but sooner or later someone will want to do it.
      fa559a86
    • Tom Lane's avatar
      Improve UniquePath logic to detect the case where the input is already · 5c74ce23
      Tom Lane authored
      known unique (eg, it is a SELECT DISTINCT ... subquery), and not do a
      redundant unique-ification step.
      5c74ce23
    • Tom Lane's avatar
      Add the ability to extract OR indexscan conditions from OR-of-AND · 9091e8d1
      Tom Lane authored
      join conditions in which each OR subclause includes a constraint on
      the same relation.  This implements the other useful side-effect of
      conversion to CNF format, without its unpleasant side-effects.  As
      per pghackers discussion of a few weeks ago.
      9091e8d1
  11. 04 Jan, 2004 2 commits
    • Tom Lane's avatar
      Merge restrictlist_selectivity into clauselist_selectivity by · 82b4dd39
      Tom Lane authored
      teaching the latter to accept either RestrictInfo nodes or bare
      clause expressions; and cache the selectivity result in the RestrictInfo
      node when possible.  This extends the caching behavior of approx_selectivity
      to many more contexts, and should reduce duplicate selectivity
      calculations.
      82b4dd39
    • Tom Lane's avatar
      Rewrite OR indexscan processing to be more flexible. We can now for the · 6cb1c023
      Tom Lane authored
      first time generate an OR indexscan for a two-column index when the WHERE
      condition is like 'col1 = foo AND (col2 = bar OR col2 = baz)' --- before,
      the OR had to be on the first column of the index or we'd not notice the
      possibility of using it.  Some progress towards extracting OR indexscans
      from subclauses of an OR that references multiple relations, too, although
      this code is #ifdef'd out because it needs more work.
      6cb1c023
  12. 30 Dec, 2003 1 commit
    • Tom Lane's avatar
      Adjust the definition of RestrictInfo's left_relids and right_relids · be6c38b9
      Tom Lane authored
      fields: now they are valid whenever the clause is a binary opclause,
      not only when it is a potential join clause (there is a new boolean
      field canjoin to signal the latter condition).  This lets us avoid
      recomputing the relid sets over and over while examining indexes.
      Still more work to do to make this as useful as it could be, because
      there are places that could use the info but don't have access to the
      RestrictInfo node.
      be6c38b9
  13. 28 Dec, 2003 1 commit
    • Tom Lane's avatar
      Clean up the usage of canonicalize_qual(): in particular, be consistent · c607bd69
      Tom Lane authored
      about whether it is applied before or after eval_const_expressions().
      I believe there were some corner cases where the system would fail to
      recognize that a partial index is applicable because of the previous
      inconsistency.  Store normal rather than 'implicit AND' representations
      of constraints and index predicates in the catalogs.
      initdb forced due to representation change of constraints/predicates.
      c607bd69
  14. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 55b11325
      PostgreSQL Daemon authored
      make sure the $Id tags are converted to $PostgreSQL as well ...
      55b11325
  15. 08 Aug, 2003 1 commit
  16. 04 Aug, 2003 2 commits
  17. 29 Jun, 2003 1 commit
    • Tom Lane's avatar
      Restructure building of join relation targetlists so that a join plan · 835bb975
      Tom Lane authored
      node emits only those vars that are actually needed above it in the
      plan tree.  (There were comments in the code suggesting that this was
      done at some point in the dim past, but for a long time we have just
      made join nodes emit everything that either input emitted.)  Aside from
      being marginally more efficient, this fixes the problem noted by Peter
      Eisentraut where a join above an IN-implemented-as-join might fail,
      because the subplan targetlist constructed in the latter case didn't
      meet the expectation of including everything.
      Along the way, fix some places that were O(N^2) in the targetlist
      length.  This is not all the trouble spots for wide queries by any
      means, but it's a step forward.
      835bb975
  18. 15 Jun, 2003 1 commit
  19. 28 May, 2003 1 commit
    • Tom Lane's avatar
      Replace functional-index facility with expressional indexes. Any column · fc8d970c
      Tom Lane authored
      of an index can now be a computed expression instead of a simple variable.
      Restrictions on expressions are the same as for predicates (only immutable
      functions, no sub-selects).  This fixes problems recently introduced with
      inlining SQL functions, because the inlining transformation is applied to
      both expression trees so the planner can still match them up.  Along the
      way, improve efficiency of handling index predicates (both predicates and
      index expressions are now cached by the relcache) and fix 7.3 oversight
      that didn't record dependencies of predicate expressions.
      fc8d970c
  20. 08 Feb, 2003 1 commit
  21. 03 Feb, 2003 1 commit
    • Tom Lane's avatar
      Tweak planner and executor to avoid doing ExecProject() in table scan · 4cff59d8
      Tom Lane authored
      nodes where it's not really necessary.  In many cases where the scan node
      is not the topmost plan node (eg, joins, aggregation), it's possible to
      just return the table tuple directly instead of generating an intermediate
      projection tuple.  In preliminary testing, this reduced the CPU time
      needed for 'SELECT COUNT(*) FROM foo' by about 10%.
      4cff59d8
  22. 20 Jan, 2003 1 commit
    • Tom Lane's avatar
      IN clauses appearing at top level of WHERE can now be handled as joins. · bdfbfde1
      Tom Lane authored
      There are two implementation techniques: the executor understands a new
      JOIN_IN jointype, which emits at most one matching row per left-hand row,
      or the result of the IN's sub-select can be fed through a DISTINCT filter
      and then joined as an ordinary relation.
      Along the way, some minor code cleanup in the optimizer; notably, break
      out most of the jointree-rearrangement preprocessing in planner.c and
      put it in a new file prep/prepjointree.c.
      bdfbfde1
  23. 15 Jan, 2003 1 commit
    • Tom Lane's avatar
      Allow merge and hash joins to occur on arbitrary expressions (anything not · de97072e
      Tom Lane authored
      containing a volatile function), rather than only on 'Var = Var' clauses
      as before.  This makes it practical to do flatten_join_alias_vars at the
      start of planning, which in turn eliminates a bunch of klugery inside the
      planner to deal with alias vars.  As a free side effect, we now detect
      implied equality of non-Var expressions; for example in
      	SELECT ... WHERE a.x = b.y and b.y = 42
      we will deduce a.x = 42 and use that as a restriction qual on a.  Also,
      we can remove the restriction introduced 12/5/02 to prevent pullup of
      subqueries whose targetlists contain sublinks.
      Still TODO: make statistical estimation routines in selfuncs.c and costsize.c
      smarter about expressions that are more complex than plain Vars.  The need
      for this is considerably greater now that we have to be able to estimate
      the suitability of merge and hash join techniques on such expressions.
      de97072e
  24. 12 Jan, 2003 1 commit
  25. 12 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 2 of read-only-plans project: restructure expression-tree nodes · a0bf885f
      Tom Lane authored
      so that all executable expression nodes inherit from a common supertype
      Expr.  This is somewhat of an exercise in code purity rather than any
      real functional advance, but getting rid of the extra Oper or Func node
      formerly used in each operator or function call should provide at least
      a little space and speed improvement.
      initdb forced by changes in stored-rules representation.
      a0bf885f
  26. 05 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 1 of read-only-plans project: cause executor state nodes to point · 1fd0c59e
      Tom Lane authored
      to plan nodes, not vice-versa.  All executor state nodes now inherit from
      struct PlanState.  Copying of plan trees has been simplified by not
      storing a list of SubPlans in Plan nodes (eliminating duplicate links).
      The executor still needs such a list, but it can build it during
      ExecutorStart since it has to scan the plan tree anyway.
      No initdb forced since no stored-on-disk structures changed, but you
      will need a full recompile because of node-numbering changes.
      1fd0c59e
  27. 30 Nov, 2002 2 commits
  28. 27 Nov, 2002 1 commit
  29. 24 Nov, 2002 1 commit
    • Tom Lane's avatar
      Restructure planning of nestloop inner indexscans so that the set of usable · 04c8785c
      Tom Lane authored
      joinclauses is determined accurately for each join.  Formerly, the code only
      considered joinclauses that used all of the rels from the outer side of the
      join; thus for example
      	FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y)
      could not exploit a two-column index on c(f1,f2), since neither of the
      qual clauses would be in the joininfo list it looked in.  The new code does
      this correctly, and also is able to eliminate redundant clauses, thus fixing
      the problem noted 24-Oct-02 by Hans-Jürgen Schönig.
      04c8785c
  30. 06 Nov, 2002 1 commit
    • Tom Lane's avatar
      First phase of implementing hash-based grouping/aggregation. An AGG plan · f6dba10e
      Tom Lane authored
      node now does its own grouping of the input rows, and has no need for a
      preceding GROUP node in the plan pipeline.  This allows elimination of
      the misnamed tuplePerGroup option for GROUP, and actually saves more code
      in nodeGroup.c than it costs in nodeAgg.c, as well as being presumably
      faster.  Restructure the API of query_planner so that we do not commit to
      using a sorted or unsorted plan in query_planner; instead grouping_planner
      makes the decision.  (Right now it isn't any smarter than query_planner
      was, but that will change as soon as it has the option to select a hash-
      based aggregation step.)  Despite all the hackery, no initdb needed since
      only in-memory node types changed.
      f6dba10e
  31. 04 Sep, 2002 1 commit
  32. 19 Aug, 2002 1 commit
    • Tom Lane's avatar
      Remove Ident nodetype in favor of using String nodes; this fixes some · 6ebc90b0
      Tom Lane authored
      latent wrong-struct-type bugs and makes the coding style more uniform,
      since the majority of places working with lists of column names were
      already using Strings not Idents.  While at it, remove vestigial
      support for Stream node type, and otherwise-unreferenced nodes.h entries
      for T_TupleCount and T_BaseNode.
      NB: full recompile is recommended due to changes of Node type numbers.
      This shouldn't force an initdb though.
      6ebc90b0
  33. 20 Jun, 2002 1 commit
  34. 12 May, 2002 1 commit