1. 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
  2. 02 Aug, 2002 1 commit
  3. 20 Jun, 2002 1 commit
  4. 26 Mar, 2002 1 commit
  5. 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
  6. 05 Nov, 2001 1 commit
  7. 28 Oct, 2001 1 commit
  8. 25 Oct, 2001 1 commit
  9. 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
  10. 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
  11. 24 Jan, 2001 1 commit
  12. 21 Nov, 2000 1 commit
  13. 23 Oct, 2000 1 commit
  14. 06 Aug, 2000 1 commit
    • Tom Lane's avatar
      Toast all the system-table columns that seem to need it. It turns out · c3e2a951
      Tom Lane authored
      that giving pg_proc a toast table required solving the same problems
      we'd have to solve for pg_class --- pg_proc is one of the relations
      that gets bootstrapped in relcache.c.  Solution is to go back at the
      end of initialization and read in the *real* pg_class row to replace
      the phony entry created by formrdesc().  This should work as long as
      there's no need to touch any toasted values during initialization,
      which seems a reasonable assumption.
      Although I did not add a toast-table for every single system table
      with a varlena attribute, I believe that it would work to just do
      ALTER TABLE pg_class CREATE TOAST TABLE.  So anyone who's really
      intent on having several thousand ACL entries for a rel could do it.
      NOTE: I didn't force initdb, but you must do one to see the effects
      of this patch.
      c3e2a951
  15. 17 Jun, 2000 1 commit
    • Tom Lane's avatar
      Fix performance problems with pg_index lookups (see, for example, · d03a933e
      Tom Lane authored
      discussion of 5/19/00).  pg_index is now searched for indexes of a
      relation using an indexscan.  Moreover, this is done once and cached
      in the relcache entry for the relation, in the form of a list of OIDs
      for the indexes.  This list is used by the parser and executor to drive
      lookups in the pg_index syscache when they want to know the properties
      of the indexes.  Net result: index information will be fully cached
      for repetitive operations such as inserts.
      d03a933e
  16. 31 Jan, 2000 1 commit
    • Tom Lane's avatar
      Fix problems seen in parallel regress tests when SI buffer overruns (causing · a152ebee
      Tom Lane authored
      syscache and relcache flushes).  Relcache entry rebuild now preserves
      original tupledesc, rewrite rules, and triggers if possible, so that pointers
      to these things remain valid --- if these things change while relcache entry
      has positive refcount, we elog(ERROR) to avoid later crash.  Arrange for
      xact-local rels to be rebuilt when an SI inval message is seen for them,
      so that they are updated by CommandCounterIncrement the same as regular rels.
      (This is useful because of Hiroshi's recent changes to process our own SI
      messages at CommandCounterIncrement time.)  This allows simplification of
      some routines that previously hacked around the lack of an automatic update.
      catcache now keeps its own copy of tupledesc for its relation, rather than
      depending on the relcache's copy; this avoids needing to reinitialize catcache
      during a cache flush, which saves some cycles and eliminates nasty circularity
      problems that occur if a cache flush happens while trying to initialize a
      catcache.
      Eliminate a number of permanent memory leaks that used to happen during
      catcache or relcache flush; not least of which was that catcache never
      freed any cached tuples!  (Rule parsetree storage is still leaked, however;
      will fix that separately.)
      Nothing done yet about code that uses tuples retrieved by SearchSysCache
      for longer than is safe.
      a152ebee
  17. 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
  18. 22 Jan, 2000 1 commit
  19. 21 Nov, 1999 1 commit
    • Tom Lane's avatar
      Repair problem exposed by Jan's new parallel-regression-test scaffold: · 76ccf73f
      Tom Lane authored
      inval.c thought it could safely use the catcache to look up the OIDs of
      system relations.  Not good, considering that inval.c could be called
      during catcache loading, if a shared-inval message arrives.  Rip out the
      lookup logic and instead use the known OIDs from pg_class.h.
      76ccf73f
  20. 03 Oct, 1999 1 commit
    • Tom Lane's avatar
      Reimplement parsing and storage of default expressions and constraint · eabc714a
      Tom Lane authored
      expressions in CREATE TABLE.  There is no longer an emasculated expression
      syntax for these things; it's full a_expr for constraints, and b_expr
      for defaults (unfortunately the fact that NOT NULL is a part of the
      column constraint syntax causes a shift/reduce conflict if you try a_expr.
      Oh well --- at least parenthesized boolean expressions work now).  Also,
      stored expression for a column default is not pre-coerced to the column
      type; we rely on transformInsertStatement to do that when the default is
      actually used.  This means "f1 datetime default 'now'" behaves the way
      people usually expect it to.
      BTW, all the support code is now there to implement ALTER TABLE ADD
      CONSTRAINT and ALTER TABLE ADD COLUMN with a default value.  I didn't
      actually teach ALTER TABLE to call it, but it wouldn't be much work.
      eabc714a
  21. 04 Sep, 1999 1 commit
    • Tom Lane's avatar
      Modify RelationFlushRelation so that if the relcache entry · b4a607c9
      Tom Lane authored
      has positive refcount, it is rebuilt from pg_class data.  This ensures
      that relcache entries will track changes made by other backends.  Formerly,
      a shared inval report would just be ignored if it happened to arrive while
      the relcache entry was in use.  Also, fix relcache to reset ref counts
      to zero during transaction abort.  Finally, change LockRelation() so that
      it checks for shared inval reports after obtaining the lock.  In this way,
      once any kind of lock has been obtained on a rel, we can trust the relcache
      entry to be up-to-date.
      b4a607c9
  22. 15 Jul, 1999 1 commit
  23. 01 May, 1999 1 commit
  24. 13 Feb, 1999 1 commit
  25. 01 Sep, 1998 1 commit
  26. 24 Jan, 1998 1 commit
  27. 08 Sep, 1997 1 commit
  28. 07 Sep, 1997 1 commit
  29. 19 Aug, 1997 1 commit
  30. 04 Jun, 1997 1 commit
  31. 10 Nov, 1996 1 commit
  32. 04 Nov, 1996 1 commit
  33. 31 Oct, 1996 1 commit
  34. 28 Aug, 1996 1 commit
  35. 09 Jul, 1996 1 commit