1. 16 11月, 2007 1 次提交
    • T
      Prevent re-use of a deleted relation's relfilenode until after the next · 6cc4451b
      Tom Lane 提交于
      checkpoint.  This guards against an unlikely data-loss scenario in which
      we re-use the relfilenode, then crash, then replay the deletion and
      recreation of the file.  Even then we'd be OK if all insertions into the
      new relation had been WAL-logged ... but that's not guaranteed given all
      the no-WAL-logging optimizations that have recently been added.
      
      Patch by Heikki Linnakangas, per a discussion last month.
      6cc4451b
  2. 06 9月, 2007 1 次提交
    • T
      Implement lazy XID allocation: transactions that do not modify any database · 295e6398
      Tom Lane 提交于
      rows will normally never obtain an XID at all.  We already did things this way
      for subtransactions, but this patch extends the concept to top-level
      transactions.  In applications where there are lots of short read-only
      transactions, this should improve performance noticeably; not so much from
      removal of the actual XID-assignments, as from reduction of overhead that's
      driven by the rate of XID consumption.  We add a concept of a "virtual
      transaction ID" so that active transactions can be uniquely identified even
      if they don't have a regular XID.  This is a much lighter-weight concept:
      uniqueness of VXIDs is only guaranteed over the short term, and no on-disk
      record is made about them.
      
      Florian Pflug, with some editorialization by Tom.
      295e6398
  3. 18 1月, 2007 1 次提交
  4. 06 1月, 2007 1 次提交
  5. 04 1月, 2007 1 次提交
    • T
      Clean up smgr.c/md.c APIs as per discussion a couple months ago. Instead of · ef072219
      Tom Lane 提交于
      having md.c return a success/failure boolean to smgr.c, which was just going
      to elog anyway, let md.c issue the elog messages itself.  This allows better
      error reporting, particularly in cases such as "short read" or "short write"
      which Peter was complaining of.  Also, remove the kluge of allowing mdread()
      to return zeroes from a read-beyond-EOF: this is now an error condition
      except when InRecovery or zero_damaged_pages = true.  (Hash indexes used to
      require that behavior, but no more.)  Also, enforce that mdwrite() is to be
      used for rewriting existing blocks while mdextend() is to be used for
      extending the relation EOF.  This restriction lets us get rid of the old
      ad-hoc defense against creating huge files by an accidental reference to
      a bogus block number: we'll only create new segments in mdextend() not
      mdwrite() or mdread().  (Again, when InRecovery we allow it anyway, since
      we need to allow updates of blocks that were later truncated away.)
      Also, clean up the original makeshift patch for bug #2737: move the
      responsibility for padding relation segments to full length into md.c.
      ef072219
  6. 24 3月, 2006 1 次提交
    • T
      Arrange to emit a description of the current XLOG record as error context · 0a202070
      Tom Lane 提交于
      when an error occurs during xlog replay.  Also, replace the former risky
      'write into a fixed-size buffer with no overflow detection' API for XLOG
      record description routines; use an expansible StringInfo instead.  (The
      latter accounts for most of the patch bulk.)
      
      Qingqing Zhou
      0a202070
  7. 05 3月, 2006 1 次提交
  8. 15 10月, 2005 1 次提交
  9. 18 6月, 2005 1 次提交
  10. 07 6月, 2005 1 次提交
  11. 11 1月, 2005 1 次提交
  12. 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
  13. 29 8月, 2004 2 次提交
  14. 17 7月, 2004 1 次提交
    • T
      Invent ResourceOwner mechanism as per my recent proposal, and use it to · fe548629
      Tom Lane 提交于
      keep track of portal-related resources separately from transaction-related
      resources.  This allows cursors to work in a somewhat sane fashion with
      nested transactions.  For now, cursor behavior is non-subtransactional,
      that is a cursor's state does not roll back if you abort a subtransaction
      that fetched from the cursor.  We might want to change that later.
      fe548629
  15. 01 7月, 2004 1 次提交
  16. 03 6月, 2004 1 次提交
    • T
      Adjust btree index build to not use shared buffers, thereby avoiding the · 2095206d
      Tom Lane 提交于
      locking conflict against concurrent CHECKPOINT that was discussed a few
      weeks ago.  Also, if not using WAL archiving (which is always true ATM
      but won't be if PITR makes it into this release), there's no need to
      WAL-log the index build process; it's sufficient to force-fsync the
      completed index before commit.  This seems to gain about a factor of 2
      in my tests, which is consistent with writing half as much data.  I did
      not try it with WAL on a separate drive though --- probably the gain would
      be a lot less in that scenario.
      2095206d
  17. 01 6月, 2004 1 次提交
  18. 31 5月, 2004 1 次提交
    • T
      Per previous discussions, get rid of use of sync(2) in favor of · 9b178555
      Tom Lane 提交于
      explicitly fsync'ing every (non-temp) file we have written since the
      last checkpoint.  In the vast majority of cases, the burden of the
      fsyncs should fall on the bgwriter process not on backends.  (To this
      end, we assume that an fsync issued by the bgwriter will force out
      blocks written to the same file by other processes using other file
      descriptors.  Anyone have a problem with that?)  This makes the world
      safe for WIN32, which ain't even got sync(2), and really makes the world
      safe for Unixen as well, because sync(2) never had the semantics we need:
      it offers no way to wait for the requested I/O to finish.
      
      Along the way, fix a bug I recently introduced in xlog recovery:
      file truncation replay failed to clear bufmgr buffers for the dropped
      blocks, which could result in 'PANIC:  heap_delete_redo: no block'
      later on in xlog replay.
      9b178555
  19. 12 2月, 2004 1 次提交
    • T
      Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, to · c3c09be3
      Tom Lane 提交于
      wit: Add a header record to each WAL segment file so that it can be reliably
      identified.  Avoid splitting WAL records across segment files (this is not
      strictly necessary, but makes it simpler to incorporate the header records).
      Make WAL entries for file creation, deletion, and truncation (as foreseen but
      never implemented by Vadim).  Also, add support for making XLOG_SEG_SIZE
      configurable at compile time, similarly to BLCKSZ.  Fix a couple bugs I
      introduced in WAL replay during recent smgr API changes.  initdb is forced
      due to changes in pg_control contents.
      c3c09be3
  20. 10 2月, 2004 1 次提交
    • T
      Restructure smgr API as per recent proposal. smgr no longer depends on · 87bd9563
      Tom Lane 提交于
      the relcache, and so the notion of 'blind write' is gone.  This should
      improve efficiency in bgwriter and background checkpoint processes.
      Internal restructuring in md.c to remove the not-very-useful array of
      MdfdVec objects --- might as well just use pointers.
      Also remove the long-dead 'persistent main memory' storage manager (mm.c),
      since it seems quite unlikely to ever get resurrected.
      87bd9563
  21. 30 11月, 2003 1 次提交
    • P
      · 55b11325
      PostgreSQL Daemon 提交于
      make sure the $Id tags are converted to $PostgreSQL as well ...
      55b11325
  22. 10 11月, 2003 1 次提交
    • T
      Add operator strategy and comparison-value datatype fields to ScanKey. · c1d62bfd
      Tom Lane 提交于
      Remove the 'strategy map' code, which was a large amount of mechanism
      that no longer had any use except reverse-mapping from procedure OID to
      strategy number.  Passing the strategy number to the index AM in the
      first place is simpler and faster.
      This is a preliminary step in planned support for cross-datatype index
      operations.  I'm committing it now since the ScanKeyEntryInitialize()
      API change touches quite a lot of files, and I want to commit those
      changes before the tree drifts under me.
      c1d62bfd
  23. 04 8月, 2003 1 次提交
  24. 06 8月, 2002 1 次提交
    • T
      Restructure local-buffer handling per recent pghackers discussion. · 5df307c7
      Tom Lane 提交于
      The local buffer manager is no longer used for newly-created relations
      (unless they are TEMP); a new non-TEMP relation goes through the shared
      bufmgr and thus will participate normally in checkpoints.  But TEMP relations
      use the local buffer manager throughout their lifespan.  Also, operations
      in TEMP relations are not logged in WAL, thus improving performance.
      Since it's no longer necessary to fsync relations as they move out of the
      local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code
      is no longer needed and has been removed: there's no concept of a dirty
      relation anymore in md.c/fd.c, and we never fsync anything but WAL.
      Still TODO: improve local buffer management algorithms so that it would
      be reasonable to increase NLocBuffer.
      5df307c7
  25. 21 6月, 2002 1 次提交
  26. 06 11月, 2001 1 次提交
  27. 28 10月, 2001 1 次提交
  28. 25 10月, 2001 1 次提交
  29. 29 9月, 2001 1 次提交
    • T
      Implement new 'lightweight lock manager' that's intermediate between · 499abb0c
      Tom Lane 提交于
      existing lock manager and spinlocks: it understands exclusive vs shared
      lock but has few other fancy features.  Replace most uses of spinlocks
      with lightweight locks.  All remaining uses of spinlocks have very short
      lock hold times (a few dozen instructions), so tweak spinlock backoff
      code to work efficiently given this assumption.  All per my proposal on
      pghackers 26-Sep-01.
      499abb0c
  30. 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
  31. 11 5月, 2001 1 次提交
    • T
      Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt was · 642107d5
      Tom Lane 提交于
      not being consulted anywhere, so remove it and remove the _mdnblocks()
      calls that were used to set it.  Change smgrextend interface to pass in
      the target block number (ie, current file length) --- the caller always
      knows this already, having already done smgrnblocks(), so it's silly to
      do it over again inside mdextend.  Net result: extension of a file now
      takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
      642107d5
  32. 22 3月, 2001 1 次提交
  33. 25 1月, 2001 1 次提交
  34. 30 11月, 2000 1 次提交
  35. 22 11月, 2000 1 次提交
  36. 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
  37. 29 10月, 2000 1 次提交
  38. 16 10月, 2000 1 次提交
  39. 05 6月, 2000 1 次提交