1. 10 Apr, 2012 6 commits
  2. 09 Apr, 2012 8 commits
  3. 08 Apr, 2012 3 commits
    • Tom Lane's avatar
      Improve management of "sticky" entries in contrib/pg_stat_statements. · d5375491
      Tom Lane authored
      This patch addresses a deficiency in the previous pg_stat_statements patch.
      We want to give sticky entries an initial "usage" factor high enough that
      they probably will stick around until their query is completed.  However,
      if the query never completes (eg it gets an error during execution), the
      entry shouldn't persist indefinitely.  Manage this by starting out with
      a usage setting equal to the (approximate) median usage value within the
      whole hashtable, but decaying the value much more aggressively than we
      do for normal entries.
      
      Peter Geoghegan
      d5375491
    • Heikki Linnakangas's avatar
      set_stack_base() no longer needs to be called in PostgresMain. · 03529a3f
      Heikki Linnakangas authored
      This was a thinko in previous commit. Now that stack base pointer is now set
      in PostmasterMain and SubPostmasterMain, it doesn't need to be set in
      PostgresMain anymore.
      03529a3f
    • Heikki Linnakangas's avatar
      Do stack-depth checking in all postmaster children. · ef3883d1
      Heikki Linnakangas authored
      We used to only initialize the stack base pointer when starting up a regular
      backend, not in other processes. In particular, autovacuum workers can run
      arbitrary user code, and without stack-depth checking, infinite recursion
      in e.g an index expression will bring down the whole cluster.
      
      The comment about PL/Java using set_stack_base() is not yet true. As the
      code stands, PL/java still modifies the stack_base_ptr variable directly.
      However, it's been discussed in the PL/Java mailing list that it should be
      changed to use the function, because PL/Java is currently oblivious to the
      register stack used on Itanium. There's another issues with PL/Java, namely
      that the stack base pointer it sets is not really the base of the stack, it
      could be something close to the bottom of the stack. That's a separate issue
      that might need some further changes to this code, but that's a different
      story.
      
      Backpatch to all supported releases.
      ef3883d1
  4. 07 Apr, 2012 4 commits
  5. 06 Apr, 2012 10 commits
  6. 05 Apr, 2012 7 commits
  7. 04 Apr, 2012 2 commits
    • Tom Lane's avatar
      Improve efficiency of dblink by using libpq's new row processor API. · 6f922ef8
      Tom Lane authored
      This patch provides a test case for libpq's row processor API.
      contrib/dblink can deal with very large result sets by dumping them into
      a tuplestore (which can spill to disk) --- but until now, the intermediate
      storage of the query result in a PGresult meant memory bloat for any large
      result.  Now we use a row processor to convert the data to tuple form and
      dump it directly into the tuplestore.
      
      A limitation is that this only works for plain dblink() queries, not
      dblink_send_query() followed by dblink_get_result().  In the latter
      case we don't know the desired tuple rowtype soon enough.  While hack
      solutions to that are possible, a different user-level API would
      probably be a better answer.
      
      Kyotaro Horiguchi, reviewed by Marko Kreen and Tom Lane
      6f922ef8
    • Tom Lane's avatar
      Add a "row processor" API to libpq for better handling of large results. · 92785dac
      Tom Lane authored
      Traditionally libpq has collected an entire query result before passing
      it back to the application.  That provides a simple and transactional API,
      but it's pretty inefficient for large result sets.  This patch allows the
      application to process each row on-the-fly instead of accumulating the
      rows into the PGresult.  Error recovery becomes a bit more complex, but
      often that tradeoff is well worth making.
      
      Kyotaro Horiguchi, reviewed by Marko Kreen and Tom Lane
      92785dac