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. 26 6月, 2001 1 次提交
    • T
      Optimizer can now estimate selectivity of IS NULL, IS NOT NULL, · 4d58a7ca
      Tom Lane 提交于
      IS TRUE, etc, with some degree of verisimilitude.  Split out
      selectivity support functions from builtins.h into a new header
      file selfuncs.h, so as to reduce the number of header files builtins.h
      must depend on.  Fix a few missing inclusions exposed thereby.
      From Joe Conway, with some kibitzing from Tom Lane.
      4d58a7ca
  3. 23 6月, 2001 1 次提交
  4. 22 6月, 2001 1 次提交
  5. 20 6月, 2001 1 次提交
    • T
      Clean up some longstanding problems in shared-cache invalidation. · bbbc00af
      Tom Lane 提交于
      SI messages now include the relevant database OID, so that operations
      in one database do not cause useless cache flushes in backends attached
      to other databases.  Declare SI messages properly using a union, to
      eliminate the former assumption that Oid is the same size as int or Index.
      Rewrite the nearly-unreadable code in inval.c, and document it better.
      Arrange for catcache flushes at end of command/transaction to happen before
      relcache flushes do --- this avoids loading a new tuple into the catcache
      while setting up new relcache entry, only to have it be flushed again
      immediately.
      bbbc00af
  6. 12 6月, 2001 1 次提交
    • T
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane 提交于
      pg_database now has unique indexes on oid and on datname.
      pg_shadow now has unique indexes on usename and on usesysid.
      pg_am now has unique index on oid.
      pg_opclass now has unique index on oid.
      pg_amproc now has unique index on amid+amopclaid+amprocnum.
      Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
      Remove index on pg_listener and associated syscache for performance reasons
      (caching rows that are certain to change before you need 'em again is
      rather pointless).
      Change pg_attrdef's nonunique index on adrelid into a unique index on
      adrelid+adnum.
      
      Fix various incorrect settings of pg_class.relisshared, make that the
      primary reference point for whether a relation is shared or not.
      IsSharedSystemRelationName() is now only consulted to initialize relisshared
      during initial creation of tables and indexes.  In theory we might now
      support shared user relations, though it's not clear how one would get
      entries for them into pg_class &etc of multiple databases.
      
      Fix recently reported bug that pg_attribute rows created for an index all have
      the same OID.  (Proof that non-unique OID doesn't matter unless it's
      actually used to do lookups ;-))
      
      There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
      relations.  Convert them into plain system catalogs without hardwired
      entries in pg_class and friends.
      
      Unify global.bki and template1.bki into a single init script postgres.bki,
      since the alleged distinction between them was misleading and pointless.
      Not to mention that it didn't work for setting up indexes on shared
      system relations.
      
      Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
      AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
      Also, hold locks until transaction commit where necessary.
      1d584f97
  7. 11 6月, 2001 1 次提交
  8. 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
  9. 07 6月, 2001 1 次提交
    • T
      Adjust WAL code so that checkpoints truncate the xlog at the previous · 1173344e
      Tom Lane 提交于
      checkpoint's redo pointer, not its undo pointer, per discussion in
      pghackers a few days ago.  No point in hanging onto undo information
      until we have the ability to do something with it --- and this solves
      a rather large problem with log space for long-running transactions.
      Also, change all calls of write() to detect the case where write
      returned a count less than requested, but failed to set errno.
      Presume that this situation indicates ENOSPC, and give the appropriate
      error message, rather than a random message associated with the previous
      value of errno.
      1173344e
  10. 03 6月, 2001 1 次提交
  11. 01 6月, 2001 2 次提交
    • T
      Clean up some minor problems exposed by further thought about Panon's bug · 0b370ea7
      Tom Lane 提交于
      report on old-style functions invoked by RI triggers.  We had a number of
      other places that were being sloppy about which memory context FmgrInfo
      subsidiary data will be allocated in.  Turns out none of them actually
      cause a problem in 7.1, but this is for arcane reasons such as the fact
      that old-style triggers aren't supported anyway.  To avoid getting burnt
      later, I've restructured the trigger support so that we don't keep trigger
      FmgrInfo structs in relcache memory.  Some other related cleanups too:
      it's not really necessary to call fmgr_info at all while setting up
      the index support info in relcache entries, because those ScanKeyEntry
      structs are never used to invoke the functions.  This should speed up
      relcache initialization a tiny bit.
      0b370ea7
    • T
      Updates to make GIST work with multi-key indexes (from Oleg Bartunov · 3043810d
      Tom Lane 提交于
      and Teodor Sigaev).  Declare key values as Datum where appropriate,
      rather than char* (Tom Lane).
      3043810d
  12. 31 5月, 2001 1 次提交
  13. 30 5月, 2001 1 次提交
  14. 25 5月, 2001 2 次提交
  15. 23 5月, 2001 1 次提交
  16. 19 5月, 2001 1 次提交
  17. 17 5月, 2001 4 次提交
    • B
      2d7795eb
    • B
      Spacing cleanup. · e044fc05
      Bruce Momjian 提交于
      e044fc05
    • B
      Small cleanup of spacing. · 806aba49
      Bruce Momjian 提交于
      806aba49
    • 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
  18. 15 5月, 2001 4 次提交
  19. 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
  20. 07 5月, 2001 1 次提交
    • T
      Rewrite of planner statistics-gathering code. ANALYZE is now available as · f905d65e
      Tom Lane 提交于
      a separate statement (though it can still be invoked as part of VACUUM, too).
      pg_statistic redesigned to be more flexible about what statistics are
      stored.  ANALYZE now collects a list of several of the most common values,
      not just one, plus a histogram (not just the min and max values).  Random
      sampling is used to make the process reasonably fast even on very large
      tables.  The number of values and histogram bins collected is now
      user-settable via an ALTER TABLE command.
      
      There is more still to do; the new stats are not being used everywhere
      they could be in the planner.  But the remaining changes for this project
      should be localized, and the behavior is already better than before.
      
      A not-very-related change is that sorting now makes use of btree comparison
      routines if it can find one, rather than invoking '<' twice.
      f905d65e
  21. 05 5月, 2001 1 次提交
  22. 04 5月, 2001 1 次提交
    • T
      Ensure that btree sort ordering functions and boolean comparison operators · 2792374c
      Tom Lane 提交于
      give consistent results for all datatypes.  Types float4, float8, and
      numeric were broken for NaN values; abstime, timestamp, and interval
      were broken for INVALID values; timetz was just plain broken (some
      possible pairs of values were neither < nor = nor >).  Also clean up
      text, bpchar, varchar, and bit/varbit to eliminate duplicate code and
      thereby reduce the probability of similar inconsistencies arising in
      the future.
      2792374c
  23. 06 4月, 2001 1 次提交
  24. 05 4月, 2001 1 次提交
  25. 26 3月, 2001 1 次提交
  26. 25 3月, 2001 1 次提交
  27. 23 3月, 2001 1 次提交
  28. 22 3月, 2001 2 次提交
  29. 19 3月, 2001 1 次提交
  30. 18 3月, 2001 2 次提交