1. 03 5月, 2003 1 次提交
    • T
      Portal and memory management infrastructure for extended query protocol. · de28dc9a
      Tom Lane 提交于
      Both plannable queries and utility commands are now always executed
      within Portals, which have been revamped so that they can handle the
      load (they used to be good only for single SELECT queries).  Restructure
      code to push command-completion-tag selection logic out of postgres.c,
      so that it won't have to be duplicated between simple and extended queries.
      initdb forced due to addition of a field to Query nodes.
      de28dc9a
  2. 05 3月, 2003 1 次提交
    • T
      Reimplement free-space-map management as per recent discussions. · 391eb5e5
      Tom Lane 提交于
      Adjustable threshold is gone in favor of keeping track of total requested
      page storage and doling out proportional fractions to each relation
      (with a minimum amount per relation, and some quantization of the results
      to avoid thrashing with small changes in page counts).  Provide special-
      case code for indexes so as not to waste space storing useless page
      free space counts.  Restructure internal data storage to be a flat array
      instead of list-of-chunks; this may cost a little more work in data
      copying when reorganizing, but allows binary search to be used during
      lookup_fsm_page_entry().
      391eb5e5
  3. 24 2月, 2003 2 次提交
  4. 22 2月, 2003 1 次提交
    • T
      More infrastructure for btree compaction project. Tree-traversal code · 799bc58d
      Tom Lane 提交于
      now knows what to do upon hitting a dead page (in theory anyway, it's
      untested...).  Add a post-VACUUM-cleanup entry point for index AMs, to
      provide a place for dead-page scavenging to happen.
      Also, fix oversight that broke btpo_prev links in temporary indexes.
      initdb forced due to additions in pg_am.
      799bc58d
  5. 09 2月, 2003 1 次提交
  6. 08 1月, 2003 1 次提交
  7. 16 12月, 2002 1 次提交
  8. 01 11月, 2002 1 次提交
    • T
      Fix miscalculation of remaining free space during tuple chain moving. · 8a45a2e9
      Tom Lane 提交于
      Only affects machines where MAXALIGN > 4, and is a boundary-condition
      case even there, but still surprising that it's not been identified
      before.  Also reduce tuple chain move give-up messages from WARNING
      to DEBUG1, since they are not unexpected conditions.
      8a45a2e9
  9. 22 10月, 2002 1 次提交
  10. 20 10月, 2002 1 次提交
  11. 28 9月, 2002 1 次提交
    • T
      ARGH! · 23616b47
      Tom Lane 提交于
      Vacuum must not advance pg_database.datvacuumxid nor truncate CLOG
      unless it's processed *all* tables in the database.  Vacuums run by
      unprivileged users don't count.
      
      (Beats head against nearest convenient wall...)
      23616b47
  12. 24 9月, 2002 1 次提交
  13. 23 9月, 2002 1 次提交
  14. 21 9月, 2002 1 次提交
  15. 05 9月, 2002 1 次提交
  16. 02 9月, 2002 1 次提交
    • T
      Code review for HeapTupleHeader changes. Add version number to page headers · c7a165ad
      Tom Lane 提交于
      (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
  17. 31 8月, 2002 1 次提交
    • T
      AUTOCOMMIT mode is now an available backend GUC variable; setting it · 26993b29
      Tom Lane 提交于
      to false provides more SQL-spec-compliant behavior than we had before.
      I am not sure that setting it false is actually a good idea yet; there
      is a lot of client-side code that will probably be broken by turning
      autocommit off.  But it's a start.
      
      Loosely based on a patch by David Van Wie.
      26993b29
  18. 14 8月, 2002 1 次提交
    • T
      Fix tuple-chain-moving tests to handle marked-for-update tuples correctly · f8b4a2e0
      Tom Lane 提交于
      (they are not part of a chain).  When failing to find a parent tuple in
      an update chain, emit a warning and abandon repair_frag, but do not give
      an error as before.  This should eliminate the infamous 'No one parent tuple
      was found' failure, which we now realize is not a can't-happen condition
      but a perfectly valid database state.  Per recent pghackers discussion.
      f8b4a2e0
  19. 06 8月, 2002 1 次提交
    • T
      Restructure local-buffer handling per recent pghackers discussion. · 5df307c7
      Tom Lane 提交于
      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
  20. 20 7月, 2002 2 次提交
    • B
      oid is needed, it is added at the end of the struct (after the null · b0f5086e
      Bruce Momjian 提交于
      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
    • B
      This patch fixes a regression caused by my recent changes to heap · e77054e0
      Bruce Momjian 提交于
      tuple header.  The fix is based on the thought that HEAP_MOVED_IN is
      not needed any more as soon as HEAP_XMIN_COMMITTED has been set.  So
      in tqual.c and vacuum.c the HEAP_MOVED bits are cleared when
      HEAP_XMIN_COMMITTED is set.
      
      Vacuum robustness is enhanced by rearranging ifs, so that we have a
      chance to elog(ERROR, ...) before an assertion fails.
      
      A new regression test is included.
      
      Manfred Koizar
      e77054e0
  21. 21 6月, 2002 1 次提交
  22. 16 6月, 2002 2 次提交
  23. 14 6月, 2002 1 次提交
  24. 25 5月, 2002 1 次提交
    • T
      Mark index entries "killed" when they are no longer visible to any · 3f4d4880
      Tom Lane 提交于
      transaction, so as to avoid returning them out of the index AM.  Saves
      repeated heap_fetch operations on frequently-updated rows.  Also detect
      queries on unique keys (equality to all columns of a unique index), and
      don't bother continuing scan once we have found first match.
      
      Killing is implemented in the btree and hash AMs, but not yet in rtree
      or gist, because there isn't an equally convenient place to do it in
      those AMs (the outer amgetnext routine can't do it without re-pinning
      the index page).
      
      Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
      index_insert to make this a little easier.
      3f4d4880
  25. 21 5月, 2002 1 次提交
    • T
      Restructure indexscan API (index_beginscan, index_getnext) per · 44fbe20d
      Tom Lane 提交于
      yesterday's proposal to pghackers.  Also remove unnecessary parameters
      to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
      new numbers of parameters for the AM interface routines, but did not
      force an initdb because nothing actually looks at those fields.
      44fbe20d
  26. 16 4月, 2002 1 次提交
  27. 13 4月, 2002 1 次提交
  28. 02 4月, 2002 2 次提交
  29. 31 3月, 2002 1 次提交
  30. 22 3月, 2002 2 次提交
    • T
      Change the aclchk.c routines to uniformly use OIDs to identify the · 56c9b73c
      Tom Lane 提交于
      objects to be privilege-checked.  Some change in their APIs would be
      necessary no matter what in the schema environment, and simply getting
      rid of the name-based interface entirely seems like the best way.
      56c9b73c
    • T
      First phase of SCHEMA changes, concentrating on fixing the grammar and · 95ef6a34
      Tom Lane 提交于
      the parsetree representation.  As yet we don't *do* anything with schema
      names, just drop 'em on the floor; but you can enter schema-compatible
      command syntax, and there's even a primitive CREATE SCHEMA command.
      No doc updates yet, except to note that you can now extract a field
      from a function-returning-row's result with (foo(...)).fieldname.
      95ef6a34
  31. 06 3月, 2002 1 次提交
    • B
      Change made to elog: · 92288a1c
      Bruce Momjian 提交于
      o  Change all current CVS messages of NOTICE to WARNING.  We were going
      to do this just before 7.3 beta but it has to be done now, as you will
      see below.
      
      o Change current INFO messages that should be controlled by
      client_min_messages to NOTICE.
      
      o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc.
      to always go to the client.
      
      o Remove INFO from the client_min_messages options and add NOTICE.
      
      Seems we do need three non-ERROR elog levels to handle the various
      behaviors we need for these messages.
      
      Regression passed.
      92288a1c
  32. 04 3月, 2002 1 次提交
    • T
      Catcaches can now store negative entries as well as positive ones, to · 26ac2171
      Tom Lane 提交于
      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
  33. 03 3月, 2002 1 次提交
    • B
      Commit to match discussed elog() changes. Only update is that LOG is · a033daf5
      Bruce Momjian 提交于
      now just below FATAL in server_min_messages.  Added more text to
      highlight ordering difference between it and client_min_messages.
      
      ---------------------------------------------------------------------------
      
      REALLYFATAL => PANIC
      STOP => PANIC
      New INFO level the prints to client by default
      New LOG level the prints to server log by default
      Cause VACUUM information to print only to the client
      NOTICE => INFO where purely information messages are sent
      DEBUG => LOG for purely server status messages
      DEBUG removed, kept as backward compatible
      DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added
      DebugLvl removed in favor of new DEBUG[1-5] symbols
      New server_min_messages GUC parameter with values:
              DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC
      New client_min_messages GUC parameter with values:
              DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC
      Server startup now logged with LOG instead of DEBUG
      Remove debug_level GUC parameter
      elog() numbers now start at 10
      Add test to print error message if older elog() values are passed to elog()
      Bootstrap mode now has a -d that requires an argument, like postmaster
      a033daf5
  34. 20 2月, 2002 1 次提交
    • T
      A bunch of changes aimed at reducing backend startup time... · 78634044
      Tom Lane 提交于
      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
  35. 06 1月, 2002 1 次提交