1. 01 Oct, 2001 1 commit
    • Tom Lane's avatar
      Another round of cleanups for dynahash.c (maybe it's finally clean of · 5999e78f
      Tom Lane authored
      portability issues).  Caller-visible data structures are now allocated
      on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'.
      Rejigger hash_create API so that caller specifies size of key and
      total size of entry, not size of key and size of rest of entry.
      This simplifies life considerably since each number is just a sizeof(),
      and padding issues etc. are taken care of automatically.
      5999e78f
  2. 29 Sep, 2001 1 commit
    • Tom Lane's avatar
      Implement new 'lightweight lock manager' that's intermediate between · 499abb0c
      Tom Lane authored
      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
  3. 06 Jul, 2001 1 commit
  4. 22 Mar, 2001 1 commit
  5. 24 Jan, 2001 1 commit
  6. 30 Nov, 2000 2 commits
  7. 28 Nov, 2000 1 commit
    • Tom Lane's avatar
      Significant cleanups in SysV IPC handling (shared mem and semaphores). · c715fdea
      Tom Lane authored
      IPC key assignment will now work correctly even when multiple postmasters
      are using same logical port number (which is possible given -k switch).
      There is only one shared-mem segment per postmaster now, not 3.
      Rip out broken code for non-TAS case in bufmgr and xlog, substitute a
      complete S_LOCK emulation using semaphores in spin.c.  TAS and non-TAS
      logic is now exactly the same.
      When deadlock is detected, "Deadlock detected" is now the elog(ERROR)
      message, rather than a NOTICE that comes out before an unhelpful ERROR.
      c715fdea
  8. 08 Nov, 2000 1 commit
    • Tom Lane's avatar
      Make DROP TABLE rollback-able: postpone physical file delete until commit. · 3908473c
      Tom Lane authored
      (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
  9. 28 Oct, 2000 1 commit
  10. 23 Oct, 2000 1 commit
  11. 20 Oct, 2000 1 commit
  12. 18 Oct, 2000 1 commit
  13. 16 Oct, 2000 1 commit
  14. 12 Apr, 2000 1 commit
  15. 09 Apr, 2000 1 commit
    • Tom Lane's avatar
      Buffer manager modifications to keep a local buffer-dirtied bit as well · 1f6d8b90
      Tom Lane authored
      as a shared dirtybit for each shared buffer.  The shared dirtybit still
      controls writing the buffer, but the local bit controls whether we need
      to fsync the buffer's file.  This arrangement fixes a bug that allowed
      some required fsyncs to be missed, and should improve performance as well.
      For more info see my post of same date on pghackers.
      1f6d8b90
  16. 26 Jan, 2000 1 commit
    • Bruce Momjian's avatar
      Add: · 5c25d602
      Bruce Momjian authored
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  17. 21 Nov, 1999 1 commit
  18. 24 Sep, 1999 1 commit
    • Tom Lane's avatar
      Several changes here, not very related but touching some of the same files. · e812458b
      Tom Lane authored
      * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22).
      * Add links to backend PROC structs to sinval's array of per-backend info,
      and use these links for routines that need to check the state of all
      backends (rather than the slow, complicated search of the ShmemIndex
      hashtable that was used before).  Add databaseOID to PROC structs.
      * Use this to implement an interlock that prevents DESTROY DATABASE of
      a database containing running backends.  (It's a little tricky to prevent
      a concurrently-starting backend from getting in there, since the new
      backend is not able to lock anything at the time it tries to look up
      its database in pg_database.  My solution is to recheck that the DB is
      OK at the end of InitPostgres.  It may not be a 100% solution, but it's
      a lot better than no interlock at all...)
      * In ALTER TABLE RENAME, flush buffers for the relation before doing the
      rename of the physical files, to ensure we don't get failures later from
      mdblindwrt().
      * Update TRUNCATE patch so that it actually compiles against current
      sources :-(.
      You should do "make clean all" after pulling these changes.
      e812458b
  19. 18 Sep, 1999 1 commit
    • Tom Lane's avatar
      Mega-commit to make heap_open/heap_openr/heap_close take an · bd272cac
      Tom Lane authored
      additional argument specifying the kind of lock to acquire/release (or
      'NoLock' to do no lock processing).  Ensure that all relations are locked
      with some appropriate lock level before being examined --- this ensures
      that relevant shared-inval messages have been processed and should prevent
      problems caused by concurrent VACUUM.  Fix several bugs having to do with
      mismatched increment/decrement of relation ref count and mismatched
      heap_open/close (which amounts to the same thing).  A bogus ref count on
      a relation doesn't matter much *unless* a SI Inval message happens to
      arrive at the wrong time, which is probably why we got away with this
      sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
      DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
      Recommend 'make clean all' after pulling this update; I modified the
      Relation struct layout slightly.
      Will post further discussion to pghackers list shortly.
      bd272cac
  20. 16 Jul, 1999 1 commit
  21. 15 Jul, 1999 1 commit
  22. 25 May, 1999 1 commit
  23. 13 Feb, 1999 1 commit
  24. 15 Dec, 1998 1 commit
  25. 01 Sep, 1998 1 commit
  26. 01 Aug, 1998 1 commit
  27. 20 Jul, 1998 1 commit
  28. 13 Jul, 1998 1 commit
  29. 15 Jun, 1998 1 commit
  30. 26 Feb, 1998 1 commit
  31. 24 Jan, 1998 1 commit
  32. 21 Nov, 1997 1 commit
  33. 08 Sep, 1997 3 commits
  34. 07 Sep, 1997 1 commit
  35. 19 Aug, 1997 1 commit
  36. 03 Aug, 1997 1 commit
  37. 28 Mar, 1997 1 commit
    • Marc G. Fournier's avatar
      From: Dan McGuirk <mcguirk@indirect.com> · 159f8c63
      Marc G. Fournier authored
      Reply-To: hackers@hub.org, Dan McGuirk <mcguirk@indirect.com>
      To: hackers@hub.org
      Subject: [HACKERS] tmin writeback optimization
      
      I was doing some profiling of the backend, and noticed that during a certain
      benchmark I was running somewhere between 30% and 75% of the backend's CPU
      time was being spent in calls to TransactionIdDidCommit() from
      HeapTupleSatisfiesNow() or HeapTupleSatisfiesItself() to determine that
      changed rows' transactions had in fact been committed even though the rows'
      tmin values had not yet been set.
      
      When a query looks at a given row, it needs to figure out whether the
      transaction that changed the row has been committed and hence it should pay
      attention to the row, or whether on the other hand the transaction is still
      in progress or has been aborted and hence the row should be ignored.  If
      a tmin value is set, it is known definitively that the row's transaction
      has been committed.  However, if tmin is not set, the transaction
      referred to in xmin must be looked up in pg_log, and this is what the
      backend was spending a lot of time doing during my benchmark.
      
      So, implementing a method suggested by Vadim, I created the following
      patch that, the first time a query finds a committed row whose tmin value
      is not set, sets it, and marks the buffer where the row is stored as
      dirty.  (It works for tmax, too.)  This doesn't result in the boost in
      real time performance I was hoping for, however it does decrease backend
      CPU usage by up to two-thirds in certain situations, so it could be
      rather beneficial in high-concurrency settings.
      159f8c63