1. 27 6月, 2013 1 次提交
    • N
      Cooperate with the Valgrind instrumentation framework. · 19085116
      Noah Misch 提交于
      Valgrind "client requests" in aset.c and mcxt.c teach Valgrind and its
      Memcheck tool about the PostgreSQL allocator.  This makes Valgrind
      roughly as sensitive to memory errors involving palloc chunks as it is
      to memory errors involving malloc chunks.  Further client requests in
      PageAddItem() and printtup() verify that all bits being added to a
      buffer page or furnished to an output function are predictably-defined.
      Those tests catch failures of C-language functions to fully initialize
      the bits of a Datum, which in turn stymie optimizations that rely on
      _equalConst().  Define the USE_VALGRIND symbol in pg_config_manual.h to
      enable these additions.  An included "suppression file" silences nominal
      errors we don't plan to fix.
      
      Reviewed in earlier versions by Peter Geoghegan and Korry Douglas.
      19085116
  2. 02 1月, 2013 1 次提交
  3. 11 6月, 2012 1 次提交
  4. 02 1月, 2012 2 次提交
    • T
      Use LWSYNC in place of SYNC/ISYNC in PPC spinlocks, where possible. · 631beeac
      Tom Lane 提交于
      This is allegedly a win, at least on some PPC implementations, according
      to the PPC ISA documents.  However, as with LWARX hints, some PPC
      platforms give an illegal-instruction failure.  Use the same trick as
      before of assuming that PPC64 platforms will accept it; we might need to
      refine that based on experience, but there are other projects doing
      likewise according to google.
      
      I did not add an assembler compatibility test because LWSYNC has been
      around much longer than hint bits, and it seems unlikely that any
      toolchains currently in use don't recognize it.
      631beeac
    • T
      Use mutex hint bit in PPC LWARX instructions, where possible. · 5cfa8dd3
      Tom Lane 提交于
      The hint bit makes for a small but measurable performance improvement
      in access to contended spinlocks.
      
      On the other hand, some PPC chips give an illegal-instruction failure.
      There doesn't seem to be a completely bulletproof way to tell whether the
      hint bit will cause an illegal-instruction failure other than by trying
      it; but most if not all 64-bit PPC machines should accept it, so follow
      the Linux kernel's lead and assume it's okay to use it in 64-bit builds.
      Of course we must also check whether the assembler accepts the command,
      since even with a recent CPU the toolchain could be old.
      
      Patch by Manabu Ori, significantly modified by me.
      5cfa8dd3
  5. 25 12月, 2011 1 次提交
    • T
      Rethink representation of index clauses' mapping to index columns. · 472d3935
      Tom Lane 提交于
      In commit e2c2c2e8 I made use of nested
      list structures to show which clauses went with which index columns, but
      on reflection that's a data structure that only an old-line Lisp hacker
      could love.  Worse, it adds unnecessary complication to the many places
      that don't much care which clauses go with which index columns.  Revert
      to the previous arrangement of flat lists of clauses, and instead add a
      parallel integer list of column numbers.  The places that care about the
      pairing can chase both lists with forboth(), while the places that don't
      care just examine one list the same as before.
      
      The only real downside to this is that there are now two more lists that
      need to be passed to amcostestimate functions in case they care about
      column matching (which btcostestimate does, so not passing the info is not
      an option).  Rather than deal with 11-argument amcostestimate functions,
      pass just the IndexPath and expect the functions to extract fields from it.
      That gets us down to 7 arguments which is better than 11, and it seems
      more future-proof against likely additions to the information we keep
      about an index path.
      472d3935
  6. 10 10月, 2011 1 次提交
    • R
      Revert accidental change to pg_config_manual.h. · c980426c
      Robert Haas 提交于
      This was broken in commit 53dbc27c, which
      introduced unlogged tables.  Fortunately, as debugging tools go, this one
      is pretty cheap, which is probably why it took nine months for someone to
      notice, but it's not intended to be enabled by default, so revert.
      
      Noted by Fujii Masao.
      c980426c
  7. 28 4月, 2011 1 次提交
  8. 29 12月, 2010 1 次提交
    • R
      Support unlogged tables. · 53dbc27c
      Robert Haas 提交于
      The contents of an unlogged table are WAL-logged; thus, they are not
      available on standby servers and are truncated whenever the database
      system enters recovery.  Indexes on unlogged tables are also unlogged.
      Unlogged GiST indexes are not currently supported.
      53dbc27c
  9. 03 12月, 2010 1 次提交
    • T
      Create core infrastructure for KNNGIST. · d583f10b
      Tom Lane 提交于
      This is a heavily revised version of builtin_knngist_core-0.9.  The
      ordering operators are no longer mixed in with actual quals, which would
      have confused not only humans but significant parts of the planner.
      Instead, ordering operators are carried separately throughout planning and
      execution.
      
      Since the API for ambeginscan and amrescan functions had to be changed
      anyway, this commit takes the opportunity to rationalize that a bit.
      RelationGetIndexScan no longer forces a premature index_rescan call;
      instead, callers of index_beginscan must call index_rescan too.  Aside from
      making the AM-side initialization logic a bit less peculiar, this has the
      advantage that we do not make a useless extra am_rescan call when there are
      runtime key values.  AMs formerly could not assume that the key values
      passed to amrescan were actually valid; now they can.
      
      Teodor Sigaev and Tom Lane
      d583f10b
  10. 21 9月, 2010 1 次提交
  11. 07 1月, 2010 1 次提交
  12. 11 6月, 2009 1 次提交
  13. 27 2月, 2009 1 次提交
  14. 12 1月, 2009 2 次提交
  15. 12 7月, 2008 1 次提交
  16. 25 6月, 2008 1 次提交
    • T
      Reduce the alignment requirement of type "name" from int to char, and arrange · 5f6f840e
      Tom Lane 提交于
      to suppress zero-padding of "name" entries in indexes.
      
      The alignment change is unlikely to save any space, but it is really needed
      anyway to make the world safe for our widespread practice of passing plain
      old C strings to functions that are declared as taking Name.  In the previous
      coding, the C compiler was entitled to assume that a Name pointer was
      word-aligned; but we were failing to guarantee that.  I think the reason
      we'd not seen failures is that usually the only thing that gets done with
      such a pointer is strcmp(), which is hard to optimize in a way that exploits
      word-alignment.  Still, some enterprising compiler guy will probably think
      of a way eventually, or we might change our code in a way that exposes
      more-obvious optimization opportunities.
      
      The padding change is accomplished in one-liner fashion by declaring the
      "name" index opclasses to use storage type "cstring" in pg_opclass.h.
      Normally btree and hash don't allow a nondefault storage type, because they
      don't have any provisions for converting the input datum to another type.
      However, because name and cstring are effectively the same thing except for
      padding, no conversion is needed --- we only need index_form_tuple() to treat
      the datum as being cstring not name, and this is sufficient.  This seems to
      make for about a one-third reduction in the typical sizes of system catalog
      indexes that involve "name" columns, of which we have many.
      
      These two changes are only weakly related, but the alignment change makes
      me feel safer that the padding change won't introduce problems, so I'm
      committing them together.
      5f6f840e
  17. 03 5月, 2008 1 次提交
  18. 02 5月, 2008 1 次提交
    • T
      Remove the recently added USE_SEGMENTED_FILES option, and indeed remove all · 3c6248a8
      Tom Lane 提交于
      support for a nonsegmented mode from md.c.  Per recent discussions, there
      doesn't seem to be much value in a "never segment" option as opposed to
      segmenting with a suitably large segment size.  So instead provide a
      configure-time switch to set the desired segment size in units of gigabytes.
      While at it, expose a configure switch for BLCKSZ as well.
      
      Zdenek Kotala
      3c6248a8
  19. 12 4月, 2008 1 次提交
    • T
      Add some debug support code to try to catch future mistakes in the area of · 65c3d05e
      Tom Lane 提交于
      input functions that include garbage bytes in their results.  Provide a
      compile-time option RANDOMIZE_ALLOCATED_MEMORY to make palloc fill returned
      blocks with variable contents.  This option also makes the parser perform
      conversions of literal constants twice and compare the results, emitting a
      WARNING if they don't match.  (This is the code I used to catch the input
      function bugs fixed in the previous commit.)  For the moment, I've set it
      to be activated automatically by --enable-cassert.
      65c3d05e
  20. 27 3月, 2008 1 次提交
    • T
      Reduce the need for frontend programs to include "postgres.h" by refactoring · 039dfbfd
      Tom Lane 提交于
      inclusions in src/include/catalog/*.h files.  The main idea here is to push
      function declarations for src/backend/catalog/*.c files into separate headers,
      rather than sticking them into the corresponding catalog definition file as
      has been done in the past.  This commit only carries out that idea fully for
      pg_proc, pg_type and pg_conversion, but that's enough for the moment ---
      if pg_list.h ever becomes unsafe for frontend code to include, we'll need
      to work a bit more.
      
      Zdenek Kotala
      039dfbfd
  21. 11 3月, 2008 1 次提交
  22. 01 3月, 2008 1 次提交
  23. 09 6月, 2007 1 次提交
  24. 24 2月, 2007 1 次提交
  25. 21 2月, 2007 1 次提交
  26. 06 2月, 2007 1 次提交
  27. 19 9月, 2006 1 次提交
    • T
      Add built-in userlock manipulation functions to replace the former · 9b4cda0d
      Tom Lane 提交于
      contrib functionality.  Along the way, remove the USER_LOCKS configuration
      symbol, since it no longer makes any sense to try to compile that out.
      No user documentation yet ... mmoncure has promised to write some.
      Thanks to Abhijit Menon-Sen for creating a first draft to work from.
      9b4cda0d
  28. 07 6月, 2006 1 次提交
    • T
      Make the planner estimate costs for nestloop inner indexscans on the basis · 8a30cc21
      Tom Lane 提交于
      that the Mackert-Lohmann formula applies across all the repetitions of the
      nestloop, not just each scan independently.  We use the M-L formula to
      estimate the number of pages fetched from the index as well as from the table;
      that isn't what it was designed for, but it seems reasonably applicable
      anyway.  This makes large numbers of repetitions look much cheaper than
      before, which accords with many reports we've received of overestimation
      of the cost of a nestloop.  Also, change the index access cost model to
      charge random_page_cost per index leaf page touched, while explicitly
      not counting anything for access to metapage or upper tree pages.  This
      may all need tweaking after we get some field experience, but in simple
      tests it seems to be giving saner results than before.  The main thing
      is to get the infrastructure in place to let cost_index() and amcostestimate
      functions take repeated scans into account at all.  Per my recent proposal.
      
      Note: this patch changes pg_proc.h, but I did not force initdb because
      the changes are basically cosmetic --- the system does not look into
      pg_proc to decide how to call an index amcostestimate function, and
      there's no way to call such a function from SQL at all.
      8a30cc21
  29. 04 4月, 2006 1 次提交
    • T
      Define a separately configurable XLOG_BLCKSZ symbol for the page size · eaef1113
      Tom Lane 提交于
      used within WAL files.  Historically this was the same as the data file
      BLCKSZ, but there's no necessary connection, and it's possible that
      performance gains might ensue from reducing XLOG_BLCKSZ.  In any case
      distinguishing two symbols should improve code clarity.  This commit
      does not actually change the page size, only provide the infrastructure
      to make it possible to do so.  initdb forced because of addition of a
      field to pg_control.
      Mark Wong, with some help from Simon Riggs and Tom Lane.
      eaef1113
  30. 05 1月, 2006 2 次提交
  31. 08 10月, 2005 1 次提交
  32. 04 10月, 2005 1 次提交
  33. 29 3月, 2005 1 次提交
  34. 10 9月, 2004 1 次提交
  35. 29 8月, 2004 1 次提交
  36. 21 5月, 2004 1 次提交
  37. 25 3月, 2004 1 次提交