1. 13 9月, 2007 1 次提交
    • T
      Redefine the lp_flags field of item pointers as having four states, rather · 68893035
      Tom Lane 提交于
      than two independent bits (one of which was never used in heap pages anyway,
      or at least hadn't been in a very long time).  This gives us flexibility to
      add the HOT notions of redirected and dead item pointers without requiring
      anything so klugy as magic values of lp_off and lp_len.  The state values
      are chosen so that for the states currently in use (pre-HOT) there is no
      change in the physical representation.
      68893035
  2. 10 6月, 2007 1 次提交
    • T
      Teach heapam code to know the difference between a real seqscan and the · 85d72f05
      Tom Lane 提交于
      pseudo HeapScanDesc created for a bitmap heap scan.  This avoids some useless
      overhead during a bitmap scan startup, in particular invoking the syncscan
      code.  (We might someday want to do that, but right now it's merely useless
      contention for shared memory, to say nothing of possibly pushing useful
      entries out of syncscan's small LRU list.)  This also allows elimination of
      ugly pgstat_discount_heap_scan() kluge.
      85d72f05
  3. 27 5月, 2007 1 次提交
    • T
      Fix up pgstats counting of live and dead tuples to recognize that committed · 77947c51
      Tom Lane 提交于
      and aborted transactions have different effects; also teach it not to assume
      that prepared transactions are always committed.
      
      Along the way, simplify the pgstats API by tying counting directly to
      Relations; I cannot detect any redeeming social value in having stats
      pointers in HeapScanDesc and IndexScanDesc structures.  And fix a few
      corner cases in which counts might be missed because the relation's
      pgstat_info pointer hadn't been set.
      77947c51
  4. 06 1月, 2007 1 次提交
  5. 27 12月, 2006 1 次提交
    • T
      Repair bug #2839: the various ExecReScan functions need to reset · 68996463
      Tom Lane 提交于
      ps_TupFromTlist in plan nodes that make use of it.  This was being done
      correctly in join nodes and Result nodes but not in any relation-scan nodes.
      Bug would lead to bogus results if a set-returning function appeared in the
      targetlist of a subquery that could be rescanned after partial execution,
      for example a subquery within EXISTS().  Bug has been around forever :-(
      ... surprising it wasn't reported before.
      68996463
  6. 04 10月, 2006 1 次提交
  7. 14 7月, 2006 1 次提交
  8. 17 6月, 2006 1 次提交
    • T
      Fix problems with cached tuple descriptors disappearing while still in use · 06e10abc
      Tom Lane 提交于
      by creating a reference-count mechanism, similar to what we did a long time
      ago for catcache entries.  The back branches have an ugly solution involving
      lots of extra copies, but this way is more efficient.  Reference counting is
      only applied to tupdescs that are actually in caches --- there seems no need
      to use it for tupdescs that are generated in the executor, since they'll go
      away during plan shutdown by virtue of being in the per-query memory context.
      Neil Conway and Tom Lane
      06e10abc
  9. 23 5月, 2006 1 次提交
    • T
      Remove CXT_printf/CXT1_printf macros. If anyone had found them to be of · 798e63ff
      Tom Lane 提交于
      any use in the past many years, we'd have made some effort to include
      them in all executor node types; but in fact they were only in
      nodeAppend.c and nodeIndexscan.c, up until I copied nodeIndexscan.c's
      occurrence into the new bitmap node types.  Remove some other unused
      macros in execdebug.h, too.  Some day the whole header probably ought to
      go away in favor of better-designed facilities.
      798e63ff
  10. 05 3月, 2006 1 次提交
  11. 28 2月, 2006 1 次提交
    • T
      Extend the ExecInitNode API so that plan nodes receive a set of flag · 2c0ef977
      Tom Lane 提交于
      bits indicating which optional capabilities can actually be exercised
      at runtime.  This will allow Sort and Material nodes, and perhaps later
      other nodes, to avoid unnecessary overhead in common cases.
      This commit just adds the infrastructure and arranges to pass the correct
      flag values down to plan nodes; none of the actual optimizations are here
      yet.  I'm committing this separately in case anyone wants to measure the
      added overhead.  (It should be negligible.)
      
      Simon Riggs and Tom Lane
      2c0ef977
  12. 03 12月, 2005 1 次提交
  13. 02 12月, 2005 1 次提交
    • T
      Rearrange code in ExecInitBitmapHeapScan so that we don't initialize the · de1dfc12
      Tom Lane 提交于
      child plan nodes until we have acquired lock on the relation to scan.
      The relative order of initialization of plan nodes isn't real important in
      other cases, but it's critical here because one is supposed to lock a
      relation before its indexes, not vice versa.  The original coding was at
      least vulnerable to deadlock against DROP INDEX, and perhaps worse things.
      de1dfc12
  14. 26 11月, 2005 1 次提交
    • T
      Change seqscan logic so that we check visibility of all tuples on a page · 70f1482d
      Tom Lane 提交于
      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
  15. 25 11月, 2005 1 次提交
    • T
      Improve ExecStoreTuple to be smarter about replacing the contents of · dab52ab1
      Tom Lane 提交于
      a TupleTableSlot: instead of calling ExecClearTuple, inline the needed
      operations, so that we can avoid redundant steps.  In particular, when
      the old and new tuples are both on the same disk page, avoid releasing
      and re-acquiring the buffer pin --- this saves work in both the bufmgr
      and ResourceOwner modules.  To make this improvement actually useful,
      partially revert a change I made on 2004-04-21 that caused SeqNext
      et al to call ExecClearTuple before ExecStoreTuple.  The motivation
      for that, to avoid grabbing the BufMgrLock separately for releasing
      the old buffer and grabbing the new one, no longer applies.  My
      profiling says that this saves about 5% of the CPU time for an
      all-in-memory seqscan.
      dab52ab1
  16. 15 10月, 2005 1 次提交
  17. 06 10月, 2005 1 次提交
    • T
      Revise pgstats stuff to fix the problems with not counting accesses · cb8b6618
      Tom Lane 提交于
      generated by bitmap index scans.  Along the way, simplify and speed up
      the code for counting sequential and index scans; it was both confusing
      and inefficient to be taking care of that in the per-tuple loops, IMHO.
      initdb forced because of internal changes in pg_stat view definitions.
      cb8b6618
  18. 07 5月, 2005 1 次提交
  19. 20 4月, 2005 1 次提交
    • T
      Create executor and planner-backend support for decoupled heap and index · 4a8c5d03
      Tom Lane 提交于
      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