1. 01 Oct, 2004 1 commit
  2. 17 Sep, 2004 1 commit
  3. 16 Sep, 2004 1 commit
    • Tom Lane's avatar
      Restructure subtransaction handling to reduce resource consumption, · 8f9f1986
      Tom Lane authored
      as per recent discussions.  Invent SubTransactionIds that are managed like
      CommandIds (ie, counter is reset at start of each top transaction), and
      use these instead of TransactionIds to keep track of subtransaction status
      in those modules that need it.  This means that a subtransaction does not
      need an XID unless it actually inserts/modifies rows in the database.
      Accordingly, don't assign it an XID nor take a lock on the XID until it
      tries to do that.  This saves a lot of overhead for subtransactions that
      are only used for error recovery (eg plpgsql exceptions).  Also, arrange
      to release a subtransaction's XID lock as soon as the subtransaction
      exits, in both the commit and abort cases.  This avoids holding many
      unique locks after a long series of subtransactions.  The price is some
      additional overhead in XactLockTableWait, but that seems acceptable.
      Finally, restructure the state machine in xact.c to have a more orthogonal
      set of states for subtransactions.
      8f9f1986
  4. 11 Sep, 2004 1 commit
    • Tom Lane's avatar
      Renumber SnapshotNow and the other special snapshot codes so that · 493f7260
      Tom Lane authored
      ((Snapshot) NULL) can no longer be confused with a valid snapshot,
      as per my recent suggestion.  Define a macro InvalidSnapshot for 0.
      Use InvalidSnapshot instead of SnapshotAny as the do-nothing special
      case for heap_update and heap_delete crosschecks; this seems a little
      cleaner even though the behavior is really the same.
      493f7260
  5. 29 Aug, 2004 2 commits
  6. 21 Jul, 2004 1 commit
    • Tom Lane's avatar
      Invent WAL timelines, as per recent discussion, to make point-in-time · 2042b342
      Tom Lane authored
      recovery more manageable.  Also, undo recent change to add FILE_HEADER
      and WASTED_SPACE records to XLOG; instead make the XLOG page header
      variable-size with extra fields in the first page of an XLOG file.
      This should fix the boundary-case bugs observed by Mark Kirkwood.
      initdb forced due to change of XLOG representation.
      2042b342
  7. 11 Jul, 2004 1 commit
    • Tom Lane's avatar
      Rename XLOG_BTREE_NEWPAGE xlog record type into XLOG_HEAP_NEWPAGE, and · 94d4d240
      Tom Lane authored
      shift support code into heapam.c accordingly.  This is in service of
      soon-to-be-committed ALTER TABLE SET TABLESPACE code that will want to
      use this same record type for both heaps and indexes.
      
      Theoretically I should have forced initdb for this, but in practice there
      is no change in xlog contents because CVS tip will never really emit this
      record type anyhow...
      94d4d240
  8. 18 Jun, 2004 1 commit
  9. 27 May, 2004 1 commit
    • Tom Lane's avatar
      Get rid of the former rather baroque mechanism for propagating the values · 16974ee9
      Tom Lane authored
      of ThisStartUpID and RedoRecPtr into new backends.  It's a lot easier just
      to make them all grab the values out of shared memory during startup.
      This helps to decouple the postmaster from checkpoint execution, which I
      need since I'm intending to let the bgwriter do it instead, and it also
      fixes a bug in the Win32 port: ThisStartUpID wasn't getting propagated at
      all AFAICS.  (Doesn't give me a lot of faith in the amount of testing that
      port has gotten.)
      16974ee9
  10. 20 May, 2004 1 commit
  11. 08 May, 2004 1 commit
    • Tom Lane's avatar
      Get rid of rd_nblocks field in relcache entries. Turns out this was · 4af34211
      Tom Lane authored
      costing us lots more to maintain than it was worth.  On shared tables
      it was of exactly zero benefit because we couldn't trust it to be
      up to date.  On temp tables it sometimes saved an lseek, but not often
      enough to be worth getting excited about.  And the real problem was that
      we forced an lseek on every relcache flush in order to update the field.
      So all in all it seems best to lose the complexity.
      4af34211
  12. 21 Apr, 2004 1 commit
    • Tom Lane's avatar
      Tweak indexscan and seqscan code to arrange that steps from one page to · 37fa3b6c
      Tom Lane authored
      the next are handled by ReleaseAndReadBuffer rather than separate
      ReleaseBuffer and ReadBuffer calls.  This cuts the number of acquisitions
      of the BufMgrLock by a factor of 2 (possibly more, if an indexscan happens
      to pull successive rows from the same heap page).  Unfortunately this
      doesn't seem enough to get us out of the recently discussed context-switch
      storm problem, but it's surely worth doing anyway.
      37fa3b6c
  13. 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
  14. 11 Mar, 2004 1 commit
  15. 16 Jan, 2004 1 commit
  16. 07 Jan, 2004 1 commit
  17. 05 Jan, 2004 1 commit
  18. 14 Dec, 2003 1 commit
    • Neil Conway's avatar
      I posted some bufmgr cleanup a few weeks ago, but it conflicted with · fef0c834
      Neil Conway authored
      some concurrent changes Jan was making to the bufmgr. Here's an
      updated version of the patch -- it should apply cleanly to CVS
      HEAD and passes the regression tests.
      
      This patch makes the following changes:
      
           - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer()
             macros, and replace uses of them with calls to the appropriate
             functions.
      
           - remove a bunch of #ifdef BMTRACE code: it is ugly & broken
             (i.e. it doesn't compile)
      
           - make BufferReplace() return a bool, not an int
      
           - cleanup some logic in bufmgr.c; should be functionality
             equivalent to the previous code, just cleaner now
      
           - remove the BM_PRIVATE flag as it is unused
      
           - improve a few comments, etc.
      fef0c834
  19. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  20. 01 Oct, 2003 1 commit
    • Tom Lane's avatar
      Repair RI trigger visibility problems (this time for sure ;-)) per recent · 55d85f42
      Tom Lane authored
      discussion on pgsql-hackers: in READ COMMITTED mode we just have to force
      a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have
      to run the scan under a current snapshot and then complain if any rows
      would be updated/deleted that are not visible in the transaction snapshot.
      55d85f42
  21. 25 Sep, 2003 1 commit
  22. 15 Sep, 2003 1 commit
    • Tom Lane's avatar
      Fix LISTEN/NOTIFY race condition reported by Gavin Sherry. While a · db18703b
      Tom Lane authored
      really general fix might be difficult, I believe the only case where
      AtCommit_Notify could see an uncommitted tuple is where the other guy
      has just unlistened and not yet committed.  The best solution seems to
      be to just skip updating that tuple, on the assumption that the other
      guy does not want to hear about the notification anyway.  This is not
      perfect --- if the other guy rolls back his unlisten instead of committing,
      then he really should have gotten this notify.  But to do that, we'd have
      to wait to see if he commits or not, or make UNLISTEN hold exclusive lock
      on pg_listener until commit.  Either of these answers is deadlock-prone,
      not to mention horrible for interactive performance.  Do it this way
      for now.  (What happened to that project to do LISTEN/NOTIFY in memory
      with no table, anyway?)
      db18703b
  23. 04 Aug, 2003 2 commits
  24. 21 Jul, 2003 1 commit
  25. 23 Feb, 2003 1 commit
  26. 13 Feb, 2003 1 commit
  27. 26 Sep, 2002 1 commit
    • Tom Lane's avatar
      Fix problems with loss of tuple commit status bits during WAL redo of · c87469e6
      Tom Lane authored
      VACUUM FULL tuple moves.  Store full-width t_infomask in WAL, rather
      than storing low 8 bits and expecting to be able to reconstruct upper
      bits.  While at it, remove redundant t_oid field from WAL headers
      (the OID, if present, is now recorded in the data portion of the tuple).
      WAL version number bumped --- this does not force an initdb, you can
      instead run pg_resetxlog after a clean shutdown of the old postmaster.
      c87469e6
  28. 04 Sep, 2002 1 commit
  29. 02 Sep, 2002 1 commit
    • Tom Lane's avatar
      Code review for HeapTupleHeader changes. Add version number to page headers · c7a165ad
      Tom Lane authored
      (overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
      per earlier discussion.  Simplify scheme for overlaying fields in tuple
      header (no need for cmax to live in more than one place).  Don't try to
      clear infomask status bits in tqual.c --- not safe to do it there.  Don't
      try to force output table of a SELECT INTO to have OIDs, either.  Get rid
      of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
      has already caused one recent failure.  Improve documentation.
      c7a165ad
  30. 29 Aug, 2002 1 commit
  31. 13 Aug, 2002 1 commit
    • Tom Lane's avatar
      Make sure that t_ctid is reset to equal t_self in heap_delete and · 0affc29e
      Tom Lane authored
      heap_mark4update; this avoids situations where a deleted tuple might
      look like it is chained to something else.  Also, cause all the WAL
      redo routines to set t_ctid to equal t_self, rather than leaving it
      undefined as before.  Make heap_xlog_clean set the page's LSN and SUI
      correctly.  All per past discussions in pghackers, ranging back to
      last December.
      0affc29e
  32. 06 Aug, 2002 1 commit
    • Tom Lane's avatar
      Restructure local-buffer handling per recent pghackers discussion. · 5df307c7
      Tom Lane authored
      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
  33. 30 Jul, 2002 1 commit
  34. 20 Jul, 2002 1 commit
    • Bruce Momjian's avatar
      oid is needed, it is added at the end of the struct (after the null · b0f5086e
      Bruce Momjian authored
      bitmap, if present).
      
      Per Tom Lane's suggestion the information whether a tuple has an oid
      or not is carried in the tuple descriptor.  For debugging reasons
      tdhasoid is of type char, not bool.  There are predefined values for
      WITHOID, WITHOUTOID and UNDEFOID.
      
      This patch has been generated against a cvs snapshot from last week
      and I don't expect it to apply cleanly to current sources.  While I
      post it here for public review, I'm working on a new version against a
      current snapshot.  (There's been heavy activity recently; hope to
      catch up some day ...)
      
      This is a long patch;  if it is too hard to swallow, I can provide it
      in smaller pieces:
      
      Part 1:  Accessor macros
      Part 2:  tdhasoid in TupDesc
      Part 3:  Regression test
      Part 4:  Parameter withoid to heap_addheader
      Part 5:  Eliminate t_oid from HeapTupleHeader
      
      Part 2 is the most hairy part because of changes in the executor and
      even in the parser;  the other parts are straightforward.
      
      Up to part 4 the patched postmaster stays binary compatible to
      databases created with an unpatched version.  Part 5 is small (100
      lines) and finally breaks compatibility.
      
      Manfred Koizar
      b0f5086e
  35. 02 Jul, 2002 2 commits
  36. 20 Jun, 2002 1 commit
  37. 15 Jun, 2002 1 commit