1. 06 11月, 2006 1 次提交
    • T
      Fix recently-understood problems with handling of XID freezing, particularly · 48188e16
      Tom Lane 提交于
      in PITR scenarios.  We now WAL-log the replacement of old XIDs with
      FrozenTransactionId, so that such replacement is guaranteed to propagate to
      PITR slave databases.  Also, rather than relying on hint-bit updates to be
      preserved, pg_clog is not truncated until all instances of an XID are known to
      have been replaced by FrozenTransactionId.  Add new GUC variables and
      pg_autovacuum columns to allow management of the freezing policy, so that
      users can trade off the size of pg_clog against the amount of freezing work
      done.  Revise the already-existing code that forces autovacuum of tables
      approaching the wraparound point to make it more bulletproof; also, revise the
      autovacuum logic so that anti-wraparound vacuuming is done per-table rather
      than per-database.  initdb forced because of changes in pg_class, pg_database,
      and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
      48188e16
  2. 16 10月, 2006 1 次提交
    • T
      Redesign the patch for allocation of shmem space and LWLocks for add-on · e0dece12
      Tom Lane 提交于
      modules; the first try was not usable in EXEC_BACKEND builds (e.g.,
      Windows).  Instead, just provide some entry points to increase the
      allocation requests during postmaster start, and provide a dedicated
      LWLock that can be used to synchronize allocation operations performed
      by backends.  Per discussion with Marc Munro.
      e0dece12
  3. 04 10月, 2006 1 次提交
  4. 28 9月, 2006 1 次提交
  5. 03 9月, 2006 1 次提交
    • T
      Arrange for GetSnapshotData to copy live-subtransaction XIDs from the · 8fad2e3f
      Tom Lane 提交于
      PGPROC array into snapshots, and use this information to avoid visits
      to pg_subtrans in HeapTupleSatisfiesSnapshot.  This appears to solve
      the pg_subtrans-related context swap storm problem that's been reported
      by several people for 8.1.  While at it, modify GetSnapshotData to not
      take an exclusive lock on ProcArrayLock, as closer analysis shows that
      shared lock is always sufficient.
      Itagaki Takahiro and Tom Lane
      8fad2e3f
  6. 02 8月, 2006 1 次提交
  7. 31 7月, 2006 1 次提交
  8. 30 7月, 2006 1 次提交
  9. 23 7月, 2006 1 次提交
  10. 16 7月, 2006 1 次提交
  11. 15 7月, 2006 1 次提交
  12. 14 7月, 2006 3 次提交
  13. 19 6月, 2006 1 次提交
  14. 08 5月, 2006 1 次提交
    • T
      Rewrite btree vacuuming to fold the former bulkdelete and cleanup operations · 5749f6ef
      Tom Lane 提交于
      into a single mostly-physical-order scan of the index.  This requires some
      ticklish interlocking considerations, but should create no material
      performance impact on normal index operations (at least given the
      already-committed changes to make scans work a page at a time).  VACUUM
      itself should get significantly faster in any index that's degenerated to a
      very nonlinear page order.  Also, we save one pass over the index entirely,
      except in the case where there were no deletions to do and so only one pass
      happened anyway.
      
      Original patch by Heikki Linnakangas, rework by Tom Lane.
      5749f6ef
  15. 05 3月, 2006 1 次提交
  16. 05 1月, 2006 1 次提交
  17. 30 12月, 2005 1 次提交
    • T
      Get rid of the SpinLockAcquire/SpinLockAcquire_NoHoldoff distinction · 195f1642
      Tom Lane 提交于
      in favor of having just one set of macros that don't do HOLD/RESUME_INTERRUPTS
      (hence, these correspond to the old SpinLockAcquire_NoHoldoff case).
      Given our coding rules for spinlock use, there is no reason to allow
      CHECK_FOR_INTERRUPTS to be done while holding a spinlock, and also there
      is no situation where ImmediateInterruptOK will be true while holding a
      spinlock.  Therefore doing HOLD/RESUME_INTERRUPTS while taking/releasing a
      spinlock is just a waste of cycles.  Qingqing Zhou and Tom Lane.
      195f1642
  18. 16 12月, 2005 1 次提交
    • T
      Rethink prior patch to filter out dead backend entries from the pgstats · fb3dbdf9
      Tom Lane 提交于
      file.  The original code probed the PGPROC array separately for each PID,
      which was not good for large numbers of backends: not only is the runtime
      O(N^2) but most of it is spent holding ProcArrayLock.  Instead, take the
      lock just once and copy the active PIDs into an array, then use qsort
      and bsearch so that the lookup time is more like O(N log N).
      fb3dbdf9
  19. 12 12月, 2005 1 次提交
    • T
      Divide the lock manager's shared state into 'partitions', so as to · ec0baf94
      Tom Lane 提交于
      reduce contention for the former single LockMgrLock.  Per my recent
      proposal.  I set it up for 16 partitions, but on a pgbench test this
      gives only a marginal further improvement over 4 partitions --- we need
      to test more scenarios to choose the number of partitions.
      ec0baf94
  20. 09 12月, 2005 1 次提交
    • T
      Simplify lock manager data structures by making a clear separation between · c599a247
      Tom Lane 提交于
      the data defining the semantics of a lock method (ie, conflict resolution
      table and ancillary data, which is all constant) and the hash tables
      storing the current state.  The only thing we give up by this is the
      ability to use separate hashtables for different lock methods, but there
      is no need for that anyway.  Put some extra fields into the LockMethod
      definition structs to clean up some other uglinesses, like hard-wired
      tests for DEFAULT_LOCKMETHOD and USER_LOCKMETHOD.  This commit doesn't
      do anything about the performance issues we were discussing, but it clears
      away some of the underbrush that's in the way of fixing that.
      c599a247
  21. 23 11月, 2005 1 次提交
  22. 15 10月, 2005 1 次提交
  23. 08 10月, 2005 1 次提交
  24. 21 8月, 2005 1 次提交
    • T
      Convert the arithmetic for shared memory size calculation from 'int' · 0007490e
      Tom Lane 提交于
      to 'Size' (that is, size_t), and install overflow detection checks in it.
      This allows us to remove the former arbitrary restrictions on NBuffers
      etc.  It won't make any difference in a 32-bit machine, but in a 64-bit
      machine you could theoretically have terabytes of shared buffers.
      (How efficiently we could manage 'em remains to be seen.)  Similarly,
      num_temp_buffers, work_mem, and maintenance_work_mem can be set above
      2Gb on a 64-bit machine.  Original patch from Koichi Suzuki, additional
      work by moi.
      0007490e
  25. 20 8月, 2005 1 次提交
  26. 01 8月, 2005 1 次提交
  27. 18 6月, 2005 1 次提交
  28. 29 5月, 2005 1 次提交
    • T
      Modify hash_search() API to prevent future occurrences of the error · e92a8827
      Tom Lane 提交于
      spotted by Qingqing Zhou.  The HASH_ENTER action now automatically
      fails with elog(ERROR) on out-of-memory --- which incidentally lets
      us eliminate duplicate error checks in quite a bunch of places.  If
      you really need the old return-NULL-on-out-of-memory behavior, you
      can ask for HASH_ENTER_NULL.  But there is now an Assert in that path
      checking that you aren't hoping to get that behavior in a palloc-based
      hash table.
      Along the way, remove the old HASH_FIND_SAVE/HASH_REMOVE_SAVED actions,
      which were not being used anywhere anymore, and were surely too ugly
      and unsafe to want to see revived again.
      e92a8827
  29. 20 5月, 2005 2 次提交
  30. 29 4月, 2005 1 次提交
    • T
      Implement sharable row-level locks, and use them for foreign key references · bedb78d3
      Tom Lane 提交于
      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
  31. 04 4月, 2005 1 次提交
  32. 01 1月, 2005 1 次提交
    • P
      · 2ff50159
      PostgreSQL Daemon 提交于
      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
  33. 30 12月, 2004 1 次提交
    • T
      Refactor EXEC_BACKEND code so that postmaster child processes reattach · eee5abce
      Tom Lane 提交于
      to shared memory as soon as possible, ie, right after read_backend_variables.
      The effective difference from the original code is that this happens
      before instead of after read_nondefault_variables(), which loads GUC
      information and is apparently capable of expanding the backend's memory
      allocation more than you'd think it should.  This should fix the
      failure-to-attach-to-shared-memory reports we've been seeing on Windows.
      Also clean up a few bits of unnecessarily grotty EXEC_BACKEND code.
      eee5abce
  34. 29 9月, 2004 2 次提交
  35. 17 9月, 2004 1 次提交
  36. 07 9月, 2004 1 次提交
    • T
      Fix a number of places where brittle data structures or overly strong · 083258e5
      Tom Lane 提交于
      Asserts would lead to a server core dump if an error occurred while
      trying to abort a failed subtransaction (thereby leading to re-execution
      of whatever parts of AbortSubTransaction had already run).  This of course
      does not prevent such an error from creating an infinite loop, but at
      least we don't make the situation worse.  Responds to an open item on
      the subtransactions to-do list.
      083258e5