1. 28 6月, 2001 1 次提交
    • T
      Install infrastructure for shared-memory free space map. Doesn't actually · e0c9301c
      Tom Lane 提交于
      do anything yet, but it has the necessary connections to initialization
      and so forth.  Make some gestures towards allowing number of blocks in
      a relation to be BlockNumber, ie, unsigned int, rather than signed int.
      (I doubt I got all the places that are sloppy about it, yet.)  On the
      way, replace the hardwired NLOCKS_PER_XACT fudge factor with a GUC
      variable.
      e0c9301c
  2. 23 6月, 2001 1 次提交
  3. 10 6月, 2001 1 次提交
    • T
      Remove RelationGetBufferWithBuffer(), which is horribly confused about · bdadc9bf
      Tom Lane 提交于
      appropriate pin-count manipulation, and instead use ReleaseAndReadBuffer.
      Make use of the fact that the passed-in buffer (if there is one) must
      be pinned to avoid grabbing the bufmgr spinlock when we are able to
      return this same buffer.  Eliminate unnecessary 'previous tuple' and
      'next tuple' fields of HeapScanDesc and IndexScanDesc, thereby removing
      a whole lot of bookkeeping from heap_getnext() and related routines.
      bdadc9bf
  4. 17 5月, 2001 3 次提交
    • B
      2d7795eb
    • B
      Spacing cleanup. · e044fc05
      Bruce Momjian 提交于
      e044fc05
    • T
      Repair race condition introduced into heap_update() in 7.1 --- · 27336e4f
      Tom Lane 提交于
      PageGetFreeSpace() was being called while not holding the buffer lock, which
      not only could yield a garbage answer, but even if it's the right answer there
      might be less space available after we reacquire the buffer lock.
      
      Also repair potential deadlock introduced by my recent performance improvement
      in RelationGetBufferForTuple(): it was possible for two heap_updates to try to
      lock two buffers in opposite orders.  The fix creates a global rule that
      buffers of a single heap relation should be locked in decreasing block number
      order.  Currently, this only applies to heap_update; VACUUM can get away with
      ignoring the rule since it holds exclusive lock on the whole relation anyway.
      However, if we try to implement a VACUUM that can run in parallel with other
      transactions, VACUUM will also have to obey the lock order rule.
      27336e4f
  5. 13 5月, 2001 1 次提交
    • T
      Modify RelationGetBufferForTuple() so that we only do lseek and lock · eedb7d18
      Tom Lane 提交于
      when we need to move to a new page; as long as we can insert the new
      tuple on the same page as before, we only need LockBuffer and not the
      expensive stuff.  Also, twiddle bufmgr interfaces to avoid redundant
      lseeks in RelationGetBufferForTuple and BufferAlloc.  Successive inserts
      now require one lseek per page added, rather than one per tuple with
      several additional ones at each page boundary as happened before.
      Lock contention when multiple backends are inserting in same table
      is also greatly reduced.
      eedb7d18
  6. 26 3月, 2001 1 次提交
  7. 22 3月, 2001 2 次提交
  8. 25 1月, 2001 1 次提交
  9. 23 1月, 2001 1 次提交
    • T
      Fix all the places that called heap_update() and heap_delete() without · 786f1a59
      Tom Lane 提交于
      bothering to check the return value --- which meant that in case the
      update or delete failed because of a concurrent update, you'd not find
      out about it, except by observing later that the transaction produced
      the wrong outcome.  There are now subroutines simple_heap_update and
      simple_heap_delete that should be used anyplace that you're not prepared
      to do the full nine yards of coping with concurrent updates.  In
      practice, that seems to mean absolutely everywhere but the executor,
      because *noplace* else was checking.
      786f1a59
  10. 15 1月, 2001 1 次提交
  11. 13 1月, 2001 1 次提交
    • T
      Add more critical-section calls: all code sections that hold spinlocks · 6162432d
      Tom Lane 提交于
      are now critical sections, so as to ensure die() won't interrupt us while
      we are munging shared-memory data structures.  Avoid insecure intermediate
      states in some code that proc_exit will call, like palloc/pfree.  Rename
      START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be
      what people tend to call them anyway, and make them be called with () like
      a function call, in hopes of not confusing pg_indent.
      I doubt that this is sufficient to make SIGTERM safe anywhere; there's
      just too much code that could get invoked during proc_exit().
      6162432d
  12. 08 1月, 2001 1 次提交
    • T
      Correct nasty error in heap_update: it was releasing the buffer refcount · a4ddbbd1
      Tom Lane 提交于
      before calling RelationInvalidateHeapTuple(), which is bad because the
      latter needs to look at the tuple data, which is in the shared disk
      buffer.  If another backend manages to recycle the buffer while this
      is going on, we will compute the wrong hashindex for the tuple or
      maybe even crash outright.  Must hold buffer refcount until afterwards.
      (This bug is not in 7.0.*; seems to be have introduced during WAL changes.)
      a4ddbbd1
  13. 30 12月, 2000 2 次提交
  14. 28 12月, 2000 2 次提交
  15. 11 12月, 2000 2 次提交
  16. 03 12月, 2000 1 次提交
  17. 01 12月, 2000 1 次提交
    • T
      Remove VARLENA_FIXED_SIZE hack, which is irreversibly broken now that · 1f5cc8c7
      Tom Lane 提交于
      both MULTIBYTE and TOAST prevent char(n) from being truly fixed-size.
      Simplify and speed up fastgetattr() and index_getattr() macros by
      eliminating special cases for attnum=1.  It's just as fast to handle
      the first attribute by presetting its attcacheoff to zero; so do that
      instead when loading the tupledesc in relcache.c.
      1f5cc8c7
  18. 30 11月, 2000 1 次提交
  19. 22 11月, 2000 1 次提交
  20. 21 11月, 2000 1 次提交
  21. 15 11月, 2000 1 次提交
  22. 09 11月, 2000 1 次提交
    • T
      Make DROP TABLE rollback-able: postpone physical file delete until commit. · 3908473c
      Tom Lane 提交于
      (WAL logging for this is not done yet, however.)  Clean up a number of really
      crufty things that are no longer needed now that DROP behaves nicely.  Make
      temp table mapper do the right things when drop or rename affecting a temp
      table is rolled back.  Also, remove "relation modified while in use" error
      check, in favor of locking tables at first reference and holding that lock
      throughout the statement.
      3908473c
  23. 30 10月, 2000 1 次提交
  24. 24 10月, 2000 1 次提交
  25. 21 10月, 2000 1 次提交
  26. 20 10月, 2000 1 次提交
  27. 13 10月, 2000 2 次提交
  28. 04 10月, 2000 1 次提交
  29. 07 9月, 2000 1 次提交
  30. 04 8月, 2000 2 次提交
    • T
      Fix tuptoaster bugs induced by making bytea toastable. Durn thing was · dd8ad641
      Tom Lane 提交于
      trying to toast tuples inserted into toast tables!  Fix is two-pronged:
      first, ensure all columns of a toast table are marked attstorage='p',
      and second, alter the target chunk size so that it's less than the
      threshold for trying to toast a tuple.  (Code tried to do that but the
      expression was wrong.)  A few cosmetic cleanups in tuptoaster too.
      NOTE: initdb forced due to change in toaster chunk-size.
      dd8ad641
    • T
      Modify heap_open()/heap_openr() API per pghackers discussion of 11 July. · 61aca818
      Tom Lane 提交于
      These two routines will now ALWAYS elog() on failure, whether you ask for
      a lock or not.  If you really want to get a NULL return on failure, call
      the new routines heap_open_nofail()/heap_openr_nofail().  By my count there
      are only about three places that actually want that behavior.  There were
      rather more than three places that were missing the check they needed to
      make under the old convention :-(.
      61aca818
  31. 22 7月, 2000 1 次提交
  32. 21 7月, 2000 1 次提交