Skip to content
Snippets Groups Projects
  1. Nov 16, 2010
    • Heikki Linnakangas's avatar
      The GiST scan algorithm uses LSNs to detect concurrent pages splits, but · 2edc5cd4
      Heikki Linnakangas authored
      temporary indexes are not WAL-logged. We used a constant LSN for temporary
      indexes, on the assumption that we don't need to worry about concurrent page
      splits in temporary indexes because they're only visible to the current
      session. But that assumption is wrong, it's possible to insert rows and
      split pages in the same session, while a scan is in progress. For example,
      by opening a cursor and fetching some rows, and INSERTing new rows before
      fetching some more.
      
      Fix by generating fake increasing LSNs, used in place of real LSNs in
      temporary GiST indexes.
      2edc5cd4
  2. Sep 20, 2010
  3. Jan 02, 2010
  4. Jul 29, 2009
    • Tom Lane's avatar
      Support deferrable uniqueness constraints. · 25d9bf2e
      Tom Lane authored
      The current implementation fires an AFTER ROW trigger for each tuple that
      looks like it might be non-unique according to the index contents at the
      time of insertion.  This works well as long as there aren't many conflicts,
      but won't scale to massive unique-key reassignments.  Improving that case
      is a TODO item.
      
      Dean Rasheed
      25d9bf2e
  5. Jan 01, 2009
  6. Nov 19, 2008
    • Heikki Linnakangas's avatar
      Rethink the way FSM truncation works. Instead of WAL-logging FSM · 33960006
      Heikki Linnakangas authored
      truncations in FSM code, call FreeSpaceMapTruncateRel from smgr_redo. To
      make that cleaner from modularity point of view, move the WAL-logging one
      level up to RelationTruncate, and move RelationTruncate and all the
      related WAL-logging to new src/backend/catalog/storage.c file. Introduce
      new RelationCreateStorage and RelationDropStorage functions that are used
      instead of calling smgrcreate/smgrscheduleunlink directly. Move the
      pending rel deletion stuff from smgrcreate/smgrscheduleunlink to the new
      functions. This leaves smgr.c as a thin wrapper around md.c; all the
      transactional stuff is now in storage.c.
      
      This will make it easier to add new forks with similar truncation logic,
      like the visibility map.
      33960006
  7. Nov 13, 2008
    • Tom Lane's avatar
      Prevent synchronous scan during GIN index build, because GIN is optimized · 10e3acb8
      Tom Lane authored
      for inserting tuples in increasing TID order.  It's not clear whether this
      fully explains Ivan Sergio Borgonovo's complaint, but simple testing
      confirms that a scan that doesn't start at block 0 can slow GIN build by
      a factor of three or four.
      
      Backpatch to 8.3.  Sync scan didn't exist before that.
      10e3acb8
  8. Nov 03, 2008
  9. Sep 30, 2008
    • Heikki Linnakangas's avatar
      Rewrite the FSM. Instead of relying on a fixed-size shared memory segment, the · 15c121b3
      Heikki Linnakangas authored
      free space information is stored in a dedicated FSM relation fork, with each
      relation (except for hash indexes; they don't use FSM).
      
      This eliminates the max_fsm_relations and max_fsm_pages GUC options; remove any
      trace of them from the backend, initdb, and documentation.
      
      Rewrite contrib/pg_freespacemap to match the new FSM implementation. Also
      introduce a new variant of the get_raw_page(regclass, int4, int4) function in
      contrib/pageinspect that let's you to return pages from any relation fork, and
      a new fsm_page_contents() function to inspect the new FSM pages.
      15c121b3
  10. Jun 12, 2008
    • Heikki Linnakangas's avatar
      Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation · a213f1ee
      Heikki Linnakangas authored
      forks. XLogOpenRelation() and the associated light-weight relation cache in
      xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
      instead of Relation.
      
      For functions that still need a Relation struct during WAL replay, there's a
      new function called CreateFakeRelcacheEntry() that returns a fake entry like
      XLogOpenRelation() used to.
      a213f1ee
  11. May 12, 2008
    • Alvaro Herrera's avatar
      Restructure some header files a bit, in particular heapam.h, by removing some · f8c4d7db
      Alvaro Herrera authored
      unnecessary #include lines in it.  Also, move some tuple routine prototypes and
      macros to htup.h, which allows removal of heapam.h inclusion from some .c
      files.
      
      For this to work, a new header file access/sysattr.h needed to be created,
      initially containing attribute numbers of system columns, for pg_dump usage.
      
      While at it, make contrib ltree, intarray and hstore header files more
      consistent with our header style.
      f8c4d7db
  12. Jan 01, 2008
  13. Nov 15, 2007
  14. Sep 20, 2007
    • Tom Lane's avatar
      HOT updates. When we update a tuple without changing any of its indexed · 282d2a03
      Tom Lane authored
      columns, and the new version can be stored on the same heap page, we no longer
      generate extra index entries for the new version.  Instead, index searches
      follow the HOT-chain links to ensure they find the correct tuple version.
      
      In addition, this patch introduces the ability to "prune" dead tuples on a
      per-page basis, without having to do a complete VACUUM pass to recover space.
      VACUUM is still needed to clean up dead index entries, however.
      
      Pavan Deolasee, with help from a bunch of other people.
      282d2a03
  15. Sep 13, 2007
    • Tom Lane's avatar
      Redefine the lp_flags field of item pointers as having four states, rather · 68893035
      Tom Lane authored
      than two independent bits (one of which was never used in heap pages anyway,
      or at least hadn't been in a very long time).  This gives us flexibility to
      add the HOT notions of redirected and dead item pointers without requiring
      anything so klugy as magic values of lp_off and lp_len.  The state values
      are chosen so that for the states currently in use (pre-HOT) there is no
      change in the physical representation.
      68893035
  16. Jan 05, 2007
  17. Nov 12, 2006
  18. Oct 04, 2006
  19. Jul 14, 2006
  20. Jul 04, 2006
    • 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
  21. Jul 02, 2006
  22. Jun 28, 2006
    • Teodor Sigaev's avatar
      Changes · 1f7ef548
      Teodor Sigaev authored
      * new split algorithm (as proposed in http://archives.postgresql.org/pgsql-hackers/2006-06/msg00254.php)
        * possible call pickSplit() for second and below columns
        * add spl_(l|r)datum_exists to GIST_SPLITVEC -
          pickSplit should check its values to use already defined
          spl_(l|r)datum for splitting. pickSplit should set
          spl_(l|r)datum_exists to 'false' (if they was 'true') to
          signal to caller about using spl_(l|r)datum.
        * support for old pickSplit(): not very optimal
          but correct split
      * remove 'bytes' field from GISTENTRY: in any case size of
        value is defined by it's type.
      * split GIST_SPLITVEC to two structures: one for using in picksplit
        and second - for internal use.
      * some code refactoring
      * support of subsplit to rtree opclasses
      
      TODO: add support of subsplit to contrib modules
      1f7ef548
  23. May 29, 2006
  24. May 24, 2006
    • Teodor Sigaev's avatar
      * Add support NULL to GiST. · d2158b02
      Teodor Sigaev authored
      * some refactoring and simplify code int gistutil.c and gist.c
      * now in some cases it can be called used-defined
        picksplit method for non-first column in index, but here
      	is a place to do more.
      * small fix of docs related to support NULL.
      d2158b02
  25. May 19, 2006
  26. May 17, 2006
  27. May 11, 2006
    • Tom Lane's avatar
      Clean up code associated with updating pg_class statistics columns · 3fdeb189
      Tom Lane authored
      (relpages/reltuples).  To do this, create formal support in heapam.c for
      "overwrite" tuple updates (including xlog replay capability) and use that
      instead of the ad-hoc overwrites we'd been using in VACUUM and CREATE INDEX.
      Take the responsibility for updating stats during CREATE INDEX out of the
      individual index AMs, and do it where it belongs, in catalog/index.c.  Aside
      from being more modular, this avoids having to update the same tuple twice in
      some paths through CREATE INDEX.  It's probably not measurably faster, but
      for sure it's a lot cleaner than before.
      3fdeb189
  28. May 10, 2006
  29. Apr 03, 2006
  30. Apr 01, 2006
    • 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
  31. Mar 31, 2006
    • Tom Lane's avatar
      Improve gist XLOG code to follow the coding rules needed to prevent · 89395bfa
      Tom Lane authored
      torn-page problems.  This introduces some issues of its own, mainly
      that there are now some critical sections of unreasonably broad scope,
      but it's a step forward anyway.  Further cleanup will require some
      code refactoring that I'd prefer to get Oleg and Teodor involved in.
      89395bfa
  32. Mar 05, 2006
  33. Nov 06, 2005
  34. Oct 18, 2005
  35. Sep 22, 2005
  36. Jun 30, 2005
  37. Jun 29, 2005
  38. Jun 28, 2005
  39. Jun 27, 2005
    • Teodor Sigaev's avatar
      Concurrency for GiST · e8cab5fe
      Teodor Sigaev authored
      - full concurrency for insert/update/select/vacuum:
              - select and vacuum never locks more than one page simultaneously
              - select (gettuple) hasn't any lock across it's calls
              - insert never locks more than two page simultaneously:
                      - during search of leaf to insert it locks only one page
                        simultaneously
                      - while walk upward to the root it locked only parent (may be
                        non-direct parent) and child. One of them X-lock, another may
                        be S- or X-lock
      - 'vacuum full' locks index
      - improve gistgetmulti
      - simplify XLOG records
      
      Fix bug in index_beginscan_internal: LockRelation may clean
        rd_aminfo structure, so move GET_REL_PROCEDURE after LockRelation
      e8cab5fe
  40. Jun 20, 2005
Loading