1. 11 Jul, 2006 1 commit
  2. 03 Jul, 2006 1 commit
    • Tom Lane's avatar
      Code review for FILLFACTOR patch. Change WITH grammar as per earlier · b7b78d24
      Tom Lane authored
      discussion (including making def_arg allow reserved words), add missed
      opt_definition for UNIQUE case.  Put the reloptions support code in a less
      random place (I chose to make a new file access/common/reloptions.c).
      Eliminate header inclusion creep.  Make the index options functions safely
      user-callable (seems like client apps might like to be able to test validity
      of options before trying to make an index).  Reduce overhead for normal case
      with no options by allowing rd_options to be NULL.  Fix some unmaintainably
      klugy code, including getting rid of Natts_pg_class_fixed at long last.
      Some stylistic cleanup too, and pay attention to keeping comments in sync
      with code.
      
      Documentation still needs work, though I did fix the omissions in
      catalogs.sgml and indexam.sgml.
      b7b78d24
  3. 02 Jul, 2006 1 commit
  4. 08 May, 2006 1 commit
    • Tom Lane's avatar
      Rewrite btree vacuuming to fold the former bulkdelete and cleanup operations · 5749f6ef
      Tom Lane authored
      into a single mostly-physical-order scan of the index.  This requires some
      ticklish interlocking considerations, but should create no material
      performance impact on normal index operations (at least given the
      already-committed changes to make scans work a page at a time).  VACUUM
      itself should get significantly faster in any index that's degenerated to a
      very nonlinear page order.  Also, we save one pass over the index entirely,
      except in the case where there were no deletions to do and so only one pass
      happened anyway.
      
      Original patch by Heikki Linnakangas, rework by Tom Lane.
      5749f6ef
  5. 25 Apr, 2006 1 commit
    • Tom Lane's avatar
      Arrange to cache btree metapage data in the relcache entry for the index, · d2896a9e
      Tom Lane authored
      thereby saving a visit to the metapage in most index searches/updates.
      This wouldn't actually save any I/O (since in the old regime the metapage
      generally stayed in cache anyway), but it does provide a useful decrease
      in bufmgr traffic in high-contention scenarios.  Per my recent proposal.
      d2896a9e
  6. 13 Apr, 2006 1 commit
    • Tom Lane's avatar
      Fix an ancient oversight in btree xlog replay. When trying to determine if an · 49a7610c
      Tom Lane authored
      upper-level insertion completes a previously-seen split, we cannot simply grab
      the downlink block number out of the buffer, because the buffer could contain
      a later state of the page --- or perhaps the page doesn't even exist at all
      any more, due to relation truncation.  These possibilities have been masked up
      to now because the use of full_page_writes effectively ensured that no xlog
      replay routine ever actually saw a page state newer than its own change.
      Since we're deprecating full_page_writes in 8.1.*, there's no need to fix this
      in existing release branches, but we need a fix in HEAD if we want to have any
      hope of re-allowing full_page_writes.  Accordingly, adjust the contents of
      btree WAL records so that we can always get the downlink block number from the
      WAL record rather than having to depend on buffer contents.  Per report from
      Kevin Grittner and Peter Brant.
      
      Improve a few comments in related code while at it.
      49a7610c
  7. 31 Mar, 2006 1 commit
    • Tom Lane's avatar
      Clean up WAL/buffer interactions as per my recent proposal. Get rid of the · a8b8f4db
      Tom Lane authored
      misleadingly-named WriteBuffer routine, and instead require routines that
      change buffer pages to call MarkBufferDirty (which does exactly what it says).
      We also require that they do so before calling XLogInsert; this takes care of
      the synchronization requirement documented in SyncOneBuffer.  Note that
      because bufmgr takes the buffer content lock (in shared mode) while writing
      out any buffer, it doesn't matter whether MarkBufferDirty is executed before
      the buffer content change is complete, so long as the content change is
      completed before releasing exclusive lock on the buffer.  So it's OK to set
      the dirtybit before we fill in the LSN.
      This eliminates the former kluge of needing to set the dirtybit in LockBuffer.
      Aside from making the code more transparent, we can also add some new
      debugging assertions, in particular that the caller of MarkBufferDirty must
      hold the buffer content lock, not merely a pin.
      a8b8f4db
  8. 05 Mar, 2006 1 commit
  9. 25 Jan, 2006 1 commit
  10. 17 Jan, 2006 1 commit
    • Tom Lane's avatar
      Improve comments about btree's use of ScanKey data structures: there · 73e35660
      Tom Lane authored
      are two basically different kinds of scankeys, and we ought to try harder
      to indicate which is used in each place in the code.  I've chosen the names
      "search scankey" and "insertion scankey", though you could make about
      as good an argument for "operator scankey" and "comparison function
      scankey".
      73e35660
  11. 11 Jan, 2006 1 commit
  12. 22 Nov, 2005 1 commit
  13. 06 Nov, 2005 1 commit
    • Tom Lane's avatar
      Add defenses to btree and hash index AMs to do simple sanity checks · 766dc45d
      Tom Lane authored
      on every index page they read; in particular to catch the case of an
      all-zero page, which PageHeaderIsValid allows to pass.  It turns out
      hash already had this idea, but it was just Assert()ing things rather
      than doing a straight error check, and the Asserts were partially
      redundant with PageHeaderIsValid anyway.  Per recent failure example
      from Jim Nasby.  (gist still needs the same treatment.)
      766dc45d
  14. 15 Oct, 2005 1 commit
  15. 12 Oct, 2005 1 commit
  16. 24 Sep, 2005 1 commit
  17. 11 Aug, 2005 1 commit
  18. 10 Aug, 2005 2 commits
  19. 06 Jun, 2005 1 commit
    • Tom Lane's avatar
      Modify XLogInsert API to make callers specify whether pages to be backed · ee7ac7b1
      Tom Lane authored
      up have the standard layout with unused space between pd_lower and pd_upper.
      When this is set, XLogInsert will omit the unused space without bothering
      to scan it to see if it's zero.  That saves time in XLogInsert, and also
      allows reversion of my earlier patch to make PageRepairFragmentation et al
      explicitly re-zero freed space.  Per suggestion by Heikki Linnakangas.
      ee7ac7b1
  20. 21 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert index-related tuple handling routines from char 'n'/' ' to bool · ee4ddac1
      Tom Lane authored
      convention for isnull flags.  Also, remove the useless InsertIndexResult
      return struct from index AM aminsert calls --- there is no reason for
      the caller to know where in the index the tuple was inserted, and we
      were wasting a palloc cycle per insert to deliver this uninteresting
      value (plus nontrivial complexity in some AMs).
      I forced initdb because of the change in the signature of the aminsert
      routines, even though nothing really looks at those pg_proc entries...
      ee4ddac1
  21. 31 Dec, 2004 1 commit
    • PostgreSQL Daemon's avatar
      · 2ff50159
      PostgreSQL Daemon authored
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  22. 26 Oct, 2004 1 commit
  23. 15 Oct, 2004 1 commit
  24. 29 Aug, 2004 2 commits
  25. 17 Aug, 2004 1 commit
    • Tom Lane's avatar
      Fix bug introduced into _bt_getstackbuf() on 2003-Feb-21: the initial · 19cd31b0
      Tom Lane authored
      value of 'start' could be past the end of the page, if the page was
      split by some concurrent inserting process since we visited it.  In
      this situation the code could look at bogus entries and possibly find
      a match (since after all those entries still contain what they had
      before the split).  This would lead to 'specified item offset is too large'
      followed by 'PANIC: failed to add item to the page', as reported by Joe
      Conway for scenarios involving heavy concurrent insertion activity.
      19cd31b0
  26. 21 Jul, 2004 1 commit
    • Tom Lane's avatar
      Invent WAL timelines, as per recent discussion, to make point-in-time · 2042b342
      Tom Lane authored
      recovery more manageable.  Also, undo recent change to add FILE_HEADER
      and WASTED_SPACE records to XLOG; instead make the XLOG page header
      variable-size with extra fields in the first page of an XLOG file.
      This should fix the boundary-case bugs observed by Mark Kirkwood.
      initdb forced due to change of XLOG representation.
      2042b342
  27. 21 Apr, 2004 1 commit
    • Tom Lane's avatar
      Tweak indexscan and seqscan code to arrange that steps from one page to · 37fa3b6c
      Tom Lane authored
      the next are handled by ReleaseAndReadBuffer rather than separate
      ReleaseBuffer and ReadBuffer calls.  This cuts the number of acquisitions
      of the BufMgrLock by a factor of 2 (possibly more, if an indexscan happens
      to pull successive rows from the same heap page).  Unfortunately this
      doesn't seem enough to get us out of the recently discussed context-switch
      storm problem, but it's surely worth doing anyway.
      37fa3b6c
  28. 07 Jan, 2004 1 commit
  29. 21 Dec, 2003 1 commit
  30. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  31. 12 Nov, 2003 1 commit
    • Tom Lane's avatar
      Cross-data-type comparisons are now indexable by btrees, pursuant to my · fa5c8a05
      Tom Lane authored
      pghackers proposal of 8-Nov.  All the existing cross-type comparison
      operators (int2/int4/int8 and float4/float8) have appropriate support.
      The original proposal of storing the right-hand-side datatype as part of
      the primary key for pg_amop and pg_amproc got modified a bit in the event;
      it is easier to store zero as the 'default' case and only store a nonzero
      when the operator is actually cross-type.  Along the way, remove the
      long-since-defunct bigbox_ops operator class.
      fa5c8a05
  32. 09 Nov, 2003 1 commit
    • Tom Lane's avatar
      Add operator strategy and comparison-value datatype fields to ScanKey. · c1d62bfd
      Tom Lane authored
      Remove the 'strategy map' code, which was a large amount of mechanism
      that no longer had any use except reverse-mapping from procedure OID to
      strategy number.  Passing the strategy number to the index AM in the
      first place is simpler and faster.
      This is a preliminary step in planned support for cross-datatype index
      operations.  I'm committing it now since the ScanKeyEntryInitialize()
      API change touches quite a lot of files, and I want to commit those
      changes before the tree drifts under me.
      c1d62bfd
  33. 25 Sep, 2003 1 commit
  34. 02 Sep, 2003 1 commit
    • Tom Lane's avatar
      In _bt_check_unique() loop, don't bother applying _bt_isequal() to · 5ac2d7c0
      Tom Lane authored
      killed items; just skip to the next item immediately.  Only check for
      key equality when we reach a non-killed item or the end of the index
      page.  This saves key comparisons when there are lots of killed items,
      as for example in a heavily-updated table that's not been vacuumed lately.
      Seems to be a win for pgbench anyway.
      5ac2d7c0
  35. 04 Aug, 2003 2 commits
  36. 28 Jul, 2003 1 commit
  37. 21 Jul, 2003 1 commit