1. 07 Dec, 2005 2 commits
    • Tom Lane's avatar
      Push the responsibility for handling ignore_killed_tuples down into · cefcbbf1
      Tom Lane authored
      _bt_checkkeys(), instead of checking it in the top-level nbtree.c routines
      as formerly.  This saves a little bit of loop overhead, but more importantly
      it lets us skip performing the index key comparisons for dead tuples.
      cefcbbf1
    • Tom Lane's avatar
      A couple of tiny performance hacks in _bt_step(). Remove PageIsEmpty · f1b059af
      Tom Lane authored
      checks, which were once needed because PageGetMaxOffsetNumber would
      fail on empty pages, but are now just redundant.  Also, don't set up
      local variables that aren't needed in the fast path --- most of the
      time, we only need to advance offnum and not step across a page boundary.
      Motivated by noticing _bt_step at the top of OProfile profile for a
      pgbench run.
      f1b059af
  2. 22 Nov, 2005 1 commit
  3. 18 Oct, 2005 1 commit
  4. 15 Oct, 2005 1 commit
  5. 06 Oct, 2005 1 commit
    • Tom Lane's avatar
      Revise pgstats stuff to fix the problems with not counting accesses · cb8b6618
      Tom Lane authored
      generated by bitmap index scans.  Along the way, simplify and speed up
      the code for counting sequential and index scans; it was both confusing
      and inefficient to be taking care of that in the per-tuple loops, IMHO.
      initdb forced because of internal changes in pg_stat view definitions.
      cb8b6618
  6. 19 Jun, 2005 1 commit
    • Tom Lane's avatar
      Avoid unnecessary palloc overhead in _bt_first(). The temporary · d961a568
      Tom Lane authored
      scankeys arrays that it needs can never have more than INDEX_MAX_KEYS
      entries, so it's reasonable to just allocate them as fixed-size local
      arrays, and save the cost of palloc/pfree.  Not a huge savings, but
      a cycle saved is a cycle earned ...
      d961a568
  7. 13 Jun, 2005 1 commit
    • Tom Lane's avatar
      Change the planner to allow indexscan qualification clauses to use · c186c931
      Tom Lane authored
      nonconsecutive columns of a multicolumn index, as per discussion around
      mid-May (pghackers thread "Best way to scan on-disk bitmaps").  This
      turns out to require only minimal changes in btree, and so far as I can
      see none at all in GiST.  btcostestimate did need some work, but its
      original assumption that index selectivity == heap selectivity was
      quite bogus even before this.
      c186c931
  8. 29 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert oidvector and int2vector into variable-length arrays. This · 70c9763d
      Tom Lane authored
      change saves a great deal of space in pg_proc and its primary index,
      and it eliminates the former requirement that INDEX_MAX_KEYS and
      FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
      in the on-disk representation (because it affects index tuple header
      size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
      to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
      There are still a lot of vestigial references to FUNC_MAX_ARGS, which
      I will clean up in a separate pass.  However, getting rid of it
      altogether would require changing the FunctionCallInfoData struct,
      and I'm not sure I want to buy into that.
      70c9763d
  9. 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
  10. 29 Aug, 2004 2 commits
  11. 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
  12. 21 Dec, 2003 3 commits
  13. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  14. 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
  15. 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
  16. 08 Aug, 2003 1 commit
  17. 04 Aug, 2003 2 commits
  18. 29 Jul, 2003 1 commit
    • Tom Lane's avatar
      Fix longstanding error in _bt_search(): should moveright at top of loop not · 892a51c3
      Tom Lane authored
      bottom.  Otherwise we fail to moveright when the root page was split while
      we were "in flight" to it.  This is not a significant problem when the root
      is above the leaf level, but if the root was also a leaf (ie, a single-page
      index just got split) we may return the wrong leaf page to the caller,
      resulting in failure to find a key that is in fact present.  Bug has existed
      at least since 7.1, probably forever.
      892a51c3
  19. 28 Jul, 2003 1 commit
  20. 21 Jul, 2003 1 commit
  21. 22 Feb, 2003 1 commit
    • Tom Lane's avatar
      More infrastructure for btree compaction project. Tree-traversal code · 799bc58d
      Tom Lane authored
      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
  22. 21 Feb, 2003 1 commit
    • Tom Lane's avatar
      Make btree index structure adjustments and WAL logging changes needed to · 70508ba7
      Tom Lane authored
      support btree compaction, as per proposal of a few days ago.  btree index
      pages no longer store parent links, instead they have a level indicator
      (counting up from zero for leaf pages).  The FixBTree recovery logic is
      removed, and replaced by code that detects missing parent-level insertions
      during WAL replay.  Also, generate appropriate WAL entries when updating
      btree metapage and when building a btree index from scratch.  I believe
      btree indexes are now completely WAL-legal for the first time.
      initdb forced due to index and WAL changes.
      70508ba7
  23. 20 Jun, 2002 1 commit
  24. 24 May, 2002 1 commit
    • Tom Lane's avatar
      Mark index entries "killed" when they are no longer visible to any · 3f4d4880
      Tom Lane authored
      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. 20 May, 2002 1 commit
    • Tom Lane's avatar
      Restructure indexscan API (index_beginscan, index_getnext) per · 44fbe20d
      Tom Lane authored
      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. 25 Oct, 2001 1 commit
  27. 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
  28. 15 Jul, 2001 1 commit
    • Tom Lane's avatar
      Restructure index AM interface for index building and index tuple deletion, · c8076f09
      Tom Lane authored
      per previous discussion on pghackers.  Most of the duplicate code in
      different AMs' ambuild routines has been moved out to a common routine
      in index.c; this means that all index types now do the right things about
      inserting recently-dead tuples, etc.  (I also removed support for EXTEND
      INDEX in the ambuild routines, since that's about to go away anyway, and
      it cluttered the code a lot.)  The retail indextuple deletion routines have
      been replaced by a "bulk delete" routine in which the indexscan is inside
      the access method.  I haven't pushed this change as far as it should go yet,
      but it should allow considerable simplification of the internal bookkeeping
      for deletions.  Also, add flag columns to pg_am to eliminate various
      hardcoded tests on AM OIDs, and remove unused pg_am columns.
      
      Fix rtree and gist index types to not attempt to store NULLs; before this,
      gist usually crashed, while rtree managed not to crash but computed wacko
      bounding boxes for NULL entries (which might have had something to do with
      the performance problems we've heard about occasionally).
      
      Add AtEOXact routines to hash, rtree, and gist, all of which have static
      state that needs to be reset after an error.  We discovered this need long
      ago for btree, but missed the other guys.
      
      Oh, one more thing: concurrent VACUUM is now the default.
      c8076f09
  29. 23 Mar, 2001 1 commit
  30. 22 Mar, 2001 2 commits
  31. 24 Jan, 2001 1 commit
  32. 25 Jul, 2000 1 commit
  33. 21 Jul, 2000 1 commit
    • Tom Lane's avatar
      Major overhaul of btree index code. Eliminate special BTP_CHAIN logic for · 9e85183b
      Tom Lane authored
      duplicate keys by letting search go to the left rather than right when an
      equal key is seen at an upper tree level.  Fix poor choice of page split
      point (leading to insertion failures) that was forced by chaining logic.
      Don't store leftmost key in non-leaf pages, since it's not necessary.
      Don't create root page until something is first stored in the index, so an
      unused index is now 8K not 16K.  (Doesn't seem to be as easy to get rid of
      the metadata page, unfortunately.)  Massive cleanup of unreadable code,
      fix poor, obsolete, and just plain wrong documentation and comments.
      See src/backend/access/nbtree/README for the gory details.
      9e85183b
  34. 30 May, 2000 1 commit