1. 03 Mar, 2002 1 commit
    • Tom Lane's avatar
      Catcaches can now store negative entries as well as positive ones, to · 26ac2171
      Tom Lane authored
      speed up repetitive failed searches; per pghackers discussion in late
      January.  inval.c logic substantially simplified, since we can now treat
      inserts and deletes alike as far as inval events are concerned.  Some
      repair work needed in heap_create_with_catalog, which turns out to have
      been doing CommandCounterIncrement at a point where the new relation has
      non-self-consistent catalog entries.  With the new inval code, that
      resulted in assert failures during a relcache entry rebuild.
      26ac2171
  2. 19 Feb, 2002 1 commit
    • Tom Lane's avatar
      A bunch of changes aimed at reducing backend startup time... · 78634044
      Tom Lane authored
      Improve 'pg_internal.init' relcache entry preload mechanism so that it is
      safe to use for all system catalogs, and arrange to preload a realistic
      set of system-catalog entries instead of only the three nailed-in-cache
      indexes that were formerly loaded this way.  Fix mechanism for deleting
      out-of-date pg_internal.init files: this must be synchronized with transaction
      commit, not just done at random times within transactions.  Drive it off
      relcache invalidation mechanism so that no special-case tests are needed.
      
      Cache additional information in relcache entries for indexes (their pg_index
      tuples and index-operator OIDs) to eliminate repeated lookups.  Also cache
      index opclass info at the per-opclass level to avoid repeated lookups during
      relcache load.
      
      Generalize 'systable scan' utilities originally developed by Hiroshi,
      move them into genam.c, use in a number of places where there was formerly
      ugly code for choosing either heap or index scan.  In particular this allows
      simplification of the logic that prevents infinite recursion between syscache
      and relcache during startup: we can easily switch to heapscans in relcache.c
      when and where needed to avoid recursion, so IndexScanOK becomes simpler and
      does not need any expensive initialization.
      
      Eliminate useless opening of a heapscan data structure while doing an indexscan
      (this saves an mdnblocks call and thus at least one kernel call).
      78634044
  3. 16 Jan, 2002 1 commit
  4. 15 Jan, 2002 1 commit
  5. 05 Nov, 2001 1 commit
  6. 28 Oct, 2001 1 commit
  7. 25 Oct, 2001 1 commit
  8. 06 Oct, 2001 1 commit
    • Tom Lane's avatar
      Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo · 85801a4d
      Tom Lane authored
      lookup info in the relcache for index access method support functions.
      This makes a huge difference for dynamically loaded support functions,
      and should save a few cycles even for built-in ones.  Also tweak dfmgr.c
      so that load_external_function is called only once, not twice, when
      doing fmgr_info for a dynamically loaded function.  All per performance
      gripe from Teodor Sigaev, 5-Oct-01.
      85801a4d
  9. 05 Oct, 2001 1 commit
    • Tom Lane's avatar
      Further cleanup of dynahash.c API, in pursuit of portability and · 8a52b893
      Tom Lane authored
      readability.  Bizarre '(long *) TRUE' return convention is gone,
      in favor of just raising an error internally in dynahash.c when
      we detect hashtable corruption.  HashTableWalk is gone, in favor
      of using hash_seq_search directly, since it had no hope of working
      with non-LONGALIGNable datatypes.  Simplify some other code that was
      made undesirably grotty by promixity to HashTableWalk.
      8a52b893
  10. 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
  11. 25 Aug, 2001 1 commit
    • Tom Lane's avatar
      Replace implementation of pg_log as a relation accessed through the · 2589735d
      Tom Lane authored
      buffer manager with 'pg_clog', a specialized access method modeled
      on pg_xlog.  This simplifies startup (don't need to play games to
      open pg_log; among other things, OverrideTransactionSystem goes away),
      should improve performance a little, and opens the door to recycling
      commit log space by removing no-longer-needed segments of the commit
      log.  Actual recycling is not there yet, but I felt I should commit
      this part separately since it'd still be useful if we chose not to
      do transaction ID wraparound.
      2589735d
  12. 10 Aug, 2001 1 commit
    • Tom Lane's avatar
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane authored
      default, but OIDS are removed from many system catalogs that don't need them.
      Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
      pg_description has a three-column key instead of one.
      
      Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
      has some usefulness; pg_dump dumps comments on indexes, rules, and
      triggers in a valid order.
      
      initdb forced.
      bf56f075
  13. 29 Jun, 2001 1 commit
    • Tom Lane's avatar
      Further work on connecting the free space map (which is still just a · af5ced9c
      Tom Lane authored
      stub) into the rest of the system.  Adopt a cleaner approach to preventing
      deadlock in concurrent heap_updates: allow RelationGetBufferForTuple to
      select any page of the rel, and put the onus on it to lock both buffers
      in a consistent order.  Remove no-longer-needed isExtend hack from
      API of ReleaseAndReadBuffer.
      af5ced9c
  14. 27 Jun, 2001 1 commit
    • Tom Lane's avatar
      Install infrastructure for shared-memory free space map. Doesn't actually · e0c9301c
      Tom Lane authored
      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
  15. 22 Jun, 2001 1 commit
  16. 18 Jun, 2001 1 commit
    • Tom Lane's avatar
      Do some restructuring to improve performance of the catcaches. Teach · 2c5aa2ac
      Tom Lane authored
      CatalogCacheFlushRelation (formerly called SystemCacheRelationFlushed)
      how to distinguish tuples it should flush from those it needn't; this
      means a relcache flush event now only removes the catcache entries
      it ought to, rather than zapping the caches completely as it used to.
      Testing with the regression tests indicates that this considerably
      improves the lifespan of catcache entries.  Also, rearrange catcache
      data structures so that the limit on number of cached tuples applies
      globally across all the catcaches, rather than being per-catcache.
      It was a little silly to have the same size limit on both, say,
      pg_attribute caches and pg_am caches (there being only four possible
      rows in the latter...).  Doing LRU removal across all the caches
      instead of locally in each one should reduce cache reload traffic
      in the more heavily used caches and improve the efficiency of
      cache memory use.
      2c5aa2ac
  17. 12 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane authored
      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
  18. 01 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up some minor problems exposed by further thought about Panon's bug · 0b370ea7
      Tom Lane authored
      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
  19. 30 May, 2001 1 commit
  20. 14 May, 2001 3 commits
  21. 02 Apr, 2001 1 commit
  22. 23 Mar, 2001 1 commit
  23. 22 Mar, 2001 1 commit
  24. 22 Feb, 2001 1 commit
  25. 24 Jan, 2001 1 commit
  26. 08 Jan, 2001 1 commit
  27. 06 Jan, 2001 2 commits
  28. 04 Jan, 2001 1 commit
  29. 02 Jan, 2001 1 commit
    • Tom Lane's avatar
      Clean up non-reentrant interface for hash_seq/HashTableWalk, so that · 1b8a219e
      Tom Lane authored
      starting a new hashtable search no longer clobbers any other search
      active anywhere in the system.  Fix RelationCacheInvalidate() so that
      it will not crash or go into an infinite loop if invoked recursively,
      as for example by a second SI Reset message arriving while we are still
      processing a prior one.
      1b8a219e
  30. 22 Dec, 2000 1 commit
  31. 09 Dec, 2000 1 commit
  32. 08 Dec, 2000 1 commit
  33. 30 Nov, 2000 2 commits
  34. 10 Nov, 2000 1 commit
    • Tom Lane's avatar
      Clean up syscache so that recursive invocation is safe, and remove error · ddeab225
      Tom Lane authored
      message about recursive use of a syscache.  Also remove most of the
      specialized indexscan routines in indexing.c --- it turns out that
      catcache.c is perfectly able to perform the indexscan for itself,
      in fact has already looked up all the information needed to do so!
      This should be faster as well as needing far less boilerplate code.
      ddeab225
  35. 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
  36. 28 Oct, 2000 1 commit