1. 26 Jul, 2006 1 commit
  2. 13 Jul, 2006 1 commit
  3. 28 Jun, 2006 2 commits
  4. 30 Apr, 2006 1 commit
  5. 05 Mar, 2006 1 commit
  6. 28 Feb, 2006 1 commit
  7. 28 Dec, 2005 1 commit
    • Tom Lane's avatar
      Implement SQL-compliant treatment of row comparisons for < <= > >= cases · 6e077097
      Tom Lane authored
      (previously we only did = and <> correctly).  Also, allow row comparisons
      with any operators that are in btree opclasses, not only those with these
      specific names.  This gets rid of a whole lot of indefensible assumptions
      about the behavior of particular operators based on their names ... though
      it's still true that IN and NOT IN expand to "= ANY".  The patch adds a
      RowCompareExpr expression node type, and makes some changes in the
      representation of ANY/ALL/ROWCOMPARE SubLinks so that they can share code
      with RowCompareExpr.
      
      I have not yet done anything about making RowCompareExpr an indexable
      operator, but will look at that soon.
      
      initdb forced due to changes in stored rules.
      6e077097
  8. 02 Dec, 2005 1 commit
  9. 28 Nov, 2005 1 commit
    • Tom Lane's avatar
      Tweak hash join code to use an additional heuristic for deciding whether · 4ab76b1c
      Tom Lane authored
      it's worth probing the outer relation for emptiness before building the
      hash table.  To wit, if we're rescanning a join previously performed,
      remember whether we found it nonempty the previous time, and don't bother
      with the probe if it was nonempty.  This buys back the performance lost
      in examples like Mario Weilguni's.
      4ab76b1c
  10. 26 Nov, 2005 2 commits
    • Tom Lane's avatar
      Teach tid-scan code to make use of "ctid = ANY (array)" clauses, so that · da27c0a1
      Tom Lane authored
      "ctid IN (list)" will still work after we convert IN to ScalarArrayOpExpr.
      Make some minor efficiency improvements while at it, such as ensuring that
      multiple TIDs are fetched in physical heap order.  And fix EXPLAIN so that
      it shows what's really going on for a TID scan.
      da27c0a1
    • Tom Lane's avatar
      Change seqscan logic so that we check visibility of all tuples on a page · 70f1482d
      Tom Lane authored
      when we first read the page, rather than checking them one at a time.
      This allows us to take and release the buffer content lock just once
      per page, instead of once per tuple.  Since it's a shared lock the
      contention penalty for holding the lock longer shouldn't be too bad.
      We can safely do this only when using an MVCC snapshot; else the
      assumption that visibility won't change over time is uncool.  Therefore
      there are now two code paths depending on the snapshot type.  I also
      made the same change in nodeBitmapHeapscan.c, where it can be done always
      because we only support MVCC snapshots for bitmap scans anyway.
      Also make some incidental cleanups in the APIs of these functions.
      Per a suggestion from Qingqing Zhou.
      70f1482d
  11. 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
  12. 22 Nov, 2005 1 commit
  13. 14 Nov, 2005 1 commit
    • Tom Lane's avatar
      Prevent ExecInsert() and ExecUpdate() from scribbling on the result tuple · 76ce39e3
      Tom Lane authored
      slot of the topmost plan node when a trigger returns a modified tuple.
      These appear to be the only places where a plan node's caller did not
      treat the result slot as read-only, which is an assumption that nodeUnique
      makes as of 8.1.  Fixes trigger-vs-DISTINCT bug reported by Frank van Vugt.
      76ce39e3
  14. 15 Oct, 2005 1 commit
  15. 25 Sep, 2005 1 commit
    • Tom Lane's avatar
      The original patch to avoid building a hash join's hashtable when the · e990b9ce
      Tom Lane authored
      outer relation is empty did not work, per test case from Patrick Welche.
      It tried to use nodeHashjoin.c's high-level mechanisms for fetching an
      outer-relation tuple, but that code expected the hash table to be filled
      already.  As patched, the code failed in corner cases such as having no
      outer-relation tuples for the first hash batch.  Revert and rewrite.
      e990b9ce
  16. 01 Aug, 2005 1 commit
  17. 26 Jun, 2005 1 commit
  18. 20 Jun, 2005 1 commit
  19. 15 Jun, 2005 1 commit
    • Neil Conway's avatar
      Change the implementation of hash join to attempt to avoid unnecessary · c119c5bd
      Neil Conway authored
      work if either of the join relations are empty. The logic is:
      
      (1) if the inner relation's startup cost is less than the outer
          relation's startup cost and this is not an outer join, read
          a single tuple from the inner relation via ExecHash()
            - if NULL, we're done
      
      (2) read a single tuple from the outer relation
            - if NULL, we're done
      
      (3) build the hash table on the inner relation
            - if hash table is empty and this is not an outer join,
              we're done
      
      (4) otherwise, do hash join as usual
      
      The implementation uses the new MultiExecProcNode API, per a
      suggestion from Tom: invoking ExecHash() now produces the first
      tuple from the Hash node's child node, whereas MultiExecHash()
      builds the hash table.
      
      I had to put in a bit of a kludge to get the row count returned
      for EXPLAIN ANALYZE to be correct: since ExecHash() is invoked to
      return a tuple, and then MultiExecHash() is invoked, we would
      return one too many tuples to EXPLAIN ANALYZE. I hacked around
      this by just manually detecting this situation and subtracting 1
      from the EXPLAIN ANALYZE row count.
      c119c5bd
  20. 14 May, 2005 1 commit
  21. 13 May, 2005 1 commit
    • Tom Lane's avatar
      Revise nodeMergejoin in light of example provided by Guillaume Smet. · 184e7a73
      Tom Lane authored
      When one side of the join has a NULL, we don't want to uselessly try
      to match it against every remaining tuple of the other side.  While
      at it, rewrite the comparison machinery to avoid multiple evaluations
      of the left and right input expressions and to use a btree comparator
      where available, instead of double operator calls.  Also revise the
      state machine to eliminate redundant comparisons and hopefully make it
      more readable too.
      184e7a73
  22. 05 May, 2005 1 commit
    • Tom Lane's avatar
      Adjust nodeBitmapIndexscan to keep the target index opened from plan · db70a312
      Tom Lane authored
      startup to end, rather than re-opening it in each MultiExecBitmapIndexScan
      call.  I had foolishly thought that opening/closing wouldn't be much
      more expensive than a rescan call, but that was sheer brain fade.
      
      This seems to fix about half of the performance lossage reported by
      Sergey Koposov.  I'm still not sure where the other half went.
      db70a312
  23. 28 Apr, 2005 1 commit
    • Tom Lane's avatar
      Implement sharable row-level locks, and use them for foreign key references · bedb78d3
      Tom Lane authored
      to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
      paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
      data structure (managed much like pg_subtrans) to represent multiple-
      transaction-ID sets.  When more than one transaction is holding a shared
      lock on a particular row, we create a MultiXactId representing that set
      of transactions and store its ID in the row's XMAX.  This scheme allows
      an effectively unlimited number of row locks, just as we did before,
      while not costing any extra overhead except when a shared lock actually
      has to be shared.   Still TODO: use the regular lock manager to control
      the grant order when multiple backends are waiting for a row lock.
      
      Alvaro Herrera and Tom Lane.
      bedb78d3
  24. 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
  25. 24 Apr, 2005 1 commit
    • Tom Lane's avatar
      Adjust nodeBitmapIndexscan.c to not keep the index open across calls, · 186655e9
      Tom Lane authored
      but just to open and close it during MultiExecBitmapIndexScan.  This
      avoids acquiring duplicate resources (eg, multiple locks on the same
      relation) in a tree with many bitmap scans.  Also, don't bother to
      lock the parent heap at all here, since we must be underneath a
      BitmapHeapScan node that will be holding a suitable lock.
      186655e9
  26. 20 Apr, 2005 1 commit
  27. 19 Apr, 2005 1 commit
    • Tom Lane's avatar
      Create executor and planner-backend support for decoupled heap and index · 4a8c5d03
      Tom Lane authored
      scans, using in-memory tuple ID bitmaps as the intermediary.  The planner
      frontend (path creation and cost estimation) is not there yet, so none
      of this code can be executed.  I have tested it using some hacked planner
      code that is far too ugly to see the light of day, however.  Committing
      now so that the bulk of the infrastructure changes go in before the tree
      drifts under me.
      4a8c5d03
  28. 25 Mar, 2005 1 commit
    • Tom Lane's avatar
      Improve EXPLAIN ANALYZE to show the time spent in each trigger when · adb1a6e9
      Tom Lane authored
      executing a statement that fires triggers.  Formerly this time was
      included in "Total runtime" but not otherwise accounted for.
      As a side benefit, we avoid re-opening relations when firing non-deferred
      AFTER triggers, because the trigger code can re-use the main executor's
      ResultRelInfo data structure.
      adb1a6e9
  29. 16 Mar, 2005 1 commit
    • Tom Lane's avatar
      Revise TupleTableSlot code to avoid unnecessary construction and disassembly · f97aebd1
      Tom Lane authored
      of tuples when passing data up through multiple plan nodes.  A slot can now
      hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
      of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
      arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
      calls to extract the data again.  This work extends Atsushi Ogawa's earlier
      patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
      (I believe however that something like this was foreseen way back in Berkeley
      days --- see the old comment on ExecProject.)  A test case involving many
      levels of join of fairly wide tables (about 80 columns altogether) showed
      about 3x overall speedup, though simple queries will probably not be
      helped very much.
      
      I have also duplicated some code in heaptuple.c in order to provide versions
      of heap_formtuple and friends that use "bool" arrays to indicate null
      attributes, instead of the old convention of "char" arrays containing either
      'n' or ' '.  This provides a better match to the convention used by
      ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
      of the old routines, I think they should be deprecated and eventually removed.
      f97aebd1
  30. 06 Mar, 2005 1 commit
  31. 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
  32. 11 Dec, 2004 1 commit
    • Tom Lane's avatar
      Instead of supposing (wrongly, in the general case) that the rowtype · 12b1b5d8
      Tom Lane authored
      of an inheritance child table is binary-compatible with the rowtype of
      its parent, invent an expression node type that does the conversion
      correctly.  Fixes the new bug exhibited by Kris Shannon as well as a
      lot of old bugs that would only show up when using multiple inheritance
      or after altering the parent table.
      12b1b5d8
  33. 07 Oct, 2004 1 commit
    • Tom Lane's avatar
      Fix problems with SQL functions returning rowtypes that have dropped · a8487e15
      Tom Lane authored
      columns.  The returned tuple needs to have appropriate NULL columns
      inserted so that it actually matches the declared rowtype.  It seemed
      convenient to use a JunkFilter for this, so I made some cleanups and
      simplifications in the JunkFilter code to allow it to support this
      additional functionality.  (That in turn exposed a latent bug in
      nodeAppend.c, which is that it was returning a tuple slot whose
      descriptor didn't match its data.)  Also, move check_sql_fn_retval
      out of pg_proc.c and into functions.c, where it seems to more naturally
      belong.
      a8487e15
  34. 29 Aug, 2004 2 commits
  35. 09 Jun, 2004 1 commit
    • Tom Lane's avatar
      Support assignment to subfields of composite columns in UPDATE and INSERT. · 7e64dbc6
      Tom Lane authored
      As a side effect, cause subscripts in INSERT targetlists to do something
      more or less sensible; previously we evaluated such subscripts and then
      effectively ignored them.  Another side effect is that UPDATE-ing an
      element or slice of an array value that is NULL now produces a non-null
      result, namely an array containing just the assigned-to positions.
      7e64dbc6
  36. 10 May, 2004 1 commit
    • Tom Lane's avatar
      Promote row expressions to full-fledged citizens of the expression syntax, · 2f63232d
      Tom Lane authored
      rather than allowing them only in a few special cases as before.  In
      particular you can now pass a ROW() construct to a function that accepts
      a rowtype parameter.  Internal generation of RowExprs fixes a number of
      corner cases that used to not work very well, such as referencing the
      whole-row result of a JOIN or subquery.  This represents a further step in
      the work I started a month or so back to make rowtype values into
      first-class citizens.
      2f63232d
  37. 01 Apr, 2004 1 commit
    • Tom Lane's avatar
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane authored
      results with tuples as ordinary varlena Datums.  This commit does not
      in itself do much for us, except eliminate the horrid memory leak
      associated with evaluation of whole-row variables.  However, it lays the
      groundwork for allowing composite types as table columns, and perhaps
      some other useful features as well.  Per my proposal of a few days ago.
      375369ac