1. 13 May, 2017 2 commits
  2. 12 May, 2017 16 commits
    • Tom Lane's avatar
      Avoid searching for callback functions in CallSyscacheCallbacks(). · 2df5d465
      Tom Lane authored
      We have now grown enough registerable syscache-invalidation callback
      functions that the original assumption that there would be few of them
      is causing performance problems.  In particular, let's fix things so that
      CallSyscacheCallbacks doesn't have to search the whole array to find
      which callback(s) to invoke for a given cache ID.  Preserve the original
      behavior that callbacks are called in order of registration, just in
      case there's someplace that depends on that (which I doubt).
      
      In support of this, export the number of syscaches from syscache.h.
      People could have found that out anyway from the enum, but adding a
      #define makes that much safer.
      
      This provides a useful additional speedup in Mathieu Fenniak's
      logical-decoding test case, although we're reaching the point of
      diminishing returns there.  I think any further improvement will have
      to come from reducing the number of cache invalidations that are
      triggered in the first place.  Still, we can hope that this change
      gives some incremental benefit for all invalidation scenarios.
      
      Back-patch to 9.4 where logical decoding was introduced.
      
      Discussion: https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com
      2df5d465
    • Bruce Momjian's avatar
      doc: update markup for release note "release date" block · 9ed74fd4
      Bruce Momjian authored
      This has to be backpatched to all supported releases so release markup
      added to HEAD and copied to back branches matches the existing markup.
      
      Reported-by: Peter Eisentraut
      
      Discussion: 2b8a2552-fffa-f7c8-97c5-14db47a87731@2ndquadrant.com
      
      Author: initial patch and sample markup by Peter Eisentraut
      
      Backpatch-through: 9.2
      9ed74fd4
    • Tom Lane's avatar
      Reduce initial size of RelfilenodeMapHash. · 8085a4f7
      Tom Lane authored
      A test case provided by Mathieu Fenniak shows that hash_seq_search'ing
      this hashtable can consume a very significant amount of overhead during
      logical decoding, which triggers frequent cache invalidation.  Testing
      suggests that the actual population of the hashtable is often no more
      than a few dozen entries, so we can cut the overhead just by dropping
      the initial number of buckets down from 1024 --- I chose to cut it to 64.
      (In situations where we do have a significant number of entries, we
      shouldn't get any real penalty from doing this, as the dynahash.c code
      will resize the hashtable automatically.)
      
      This gives a further factor-of-two savings in Mathieu's test case.
      That may be overly optimistic for real-world benefit, as real cases
      may have larger average table populations, but it's hard to see it
      turning into a net negative for any workload.
      
      Back-patch to 9.4 where relfilenodemap.c was introduced.
      
      Discussion: https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com
      8085a4f7
    • Alvaro Herrera's avatar
      getObjectDescription: support extended statistics · 5e2af609
      Alvaro Herrera authored
      This was missed in 7b504eb2.
      
      Remove the "default:" clause in the switch, to avoid this problem in the
      future.  Other switches involving the same enum should probably be
      changed in the same way, but are not touched by this patch.
      
      Discussion: https://postgr.es/m/20170512204800.iqt2uwyx3c32j45r@alvherre.pgsql
      5e2af609
    • Tom Lane's avatar
      Avoid searching for the target catcache in CatalogCacheIdInvalidate. · 50ee1c74
      Tom Lane authored
      A test case provided by Mathieu Fenniak shows that the initial search for
      the target catcache in CatalogCacheIdInvalidate consumes a very significant
      amount of overhead in cases where cache invalidation is triggered but has
      little useful work to do.  There is no good reason for that search to exist
      at all, as the index array maintained by syscache.c allows direct lookup of
      the catcache from its ID.  We just need a frontend function in syscache.c,
      matching the division of labor for most other cache-accessing operations.
      
      While there's more that can be done in this area, this patch alone reduces
      the runtime of Mathieu's example by 2X.  We can hope that it offers some
      useful benefit in other cases too, although usually cache invalidation
      overhead is not such a striking fraction of the total runtime.
      
      Back-patch to 9.4 where logical decoding was introduced.  It might be
      worth going further back, but presently the only case we know of where
      cache invalidation is really a significant burden is in logical decoding.
      Also, older branches have fewer catcaches, reducing the possible benefit.
      
      (Note: although this nominally changes catcache's API, we have always
      documented CatalogCacheIdInvalidate as a private function, so I would
      have little sympathy for an external module calling it directly.  So
      backpatching should be fine.)
      
      Discussion: https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com
      50ee1c74
    • Tom Lane's avatar
      Fix dependencies for extended statistics objects. · 928c4de3
      Tom Lane authored
      A stats object ought to have a dependency on each individual column
      it reads, not the entire table.  Doing this honestly lets us get rid
      of the hard-wired logic in RemoveStatisticsExt, which seems to have
      been misguidedly modeled on RemoveStatistics; and it will be far easier
      to extend to multiple tables later.
      
      Also, add overlooked dependency on owner, and make the dependency on
      schema be NORMAL like every other such dependency.
      
      There remains some unfinished work here, which is to allow statistics
      objects to be extension members.  That takes more effort than just
      adding the dependency call, though, so I left it out for now.
      
      initdb forced because this changes the set of pg_depend records that
      should exist for a statistics object.
      
      Discussion: https://postgr.es/m/22676.1494557205@sss.pgh.pa.us
      928c4de3
    • Alvaro Herrera's avatar
      Change CREATE STATISTICS syntax · bc085205
      Alvaro Herrera authored
      Previously, we had the WITH clause in the middle of the command, where
      you'd specify both generic options as well as statistic types.  Few
      people liked this, so this commit changes it to remove the WITH keyword
      from that clause and makes it accept statistic types only.  (We
      currently don't have any generic options, but if we invent in the
      future, we will gain a new WITH clause, probably at the end of the
      command).
      
      Also, the column list is now specified without parens, which makes the
      whole command look more similar to a SELECT command.  This change will
      let us expand the command to supporting expressions (not just columns
      names) as well as multiple tables and their join conditions.
      
      Tom added lots of code comments and fixed some parts of the CREATE
      STATISTICS reference page, too; more changes in this area are
      forthcoming.  He also fixed a potential problem in the alter_generic
      regression test, reducing verbosity on a cascaded drop to avoid
      dependency on message ordering, as we do in other tests.
      
      Tom also closed a security bug: we documented that table ownership was
      required in order to create a statistics object on it, but didn't
      actually implement it.
      
      Implement tab-completion for statistics objects.  This can stand some
      more improvement.
      
      Authors: Alvaro Herrera, with lots of cleanup by Tom Lane
      Discussion: https://postgr.es/m/20170420212426.ltvgyhnefvhixm6i@alvherre.pgsql
      bc085205
    • Peter Eisentraut's avatar
    • Peter Eisentraut's avatar
      Standardize "WAL location" terminology · d496a657
      Peter Eisentraut authored
      Other previously used terms were "WAL position" or "log position".
      d496a657
    • Peter Eisentraut's avatar
      Replace "transaction log" with "write-ahead log" · c1a7f64b
      Peter Eisentraut authored
      This makes documentation and error messages match the renaming of "xlog"
      to "wal" in APIs and file naming.
      c1a7f64b
    • Andrew Dunstan's avatar
      Honor PROVE_FLAGS environment setting · 56b6ef89
      Andrew Dunstan authored
      On MSVC builds and on back branches that means removing the hardcoded
      --verbose setting. On master for Unix that means removing the empty
      setting in the global Makefile so that the value can be acquired from
      the environment as well as from the make arguments.
      
      Backpatch to 9.4 where we introduced TAP tests
      56b6ef89
    • Andrew Dunstan's avatar
      Add libxml2 include path for MSVC builds · b757e01f
      Andrew Dunstan authored
      On Unix this path is detected via the use of xml2-config, but that's not
      available on Windows. This means that users building with libxml2 will
      no longer need to move things around from the standard libxml2
      installation for MSVC builds.
      
      Backpatch to all live branches.
      b757e01f
    • Peter Eisentraut's avatar
      pg_dump: Add --no-publications option · 96e1cb4c
      Peter Eisentraut authored
      Author: Michael Paquier <michael.paquier@gmail.com>
      96e1cb4c
    • Peter Eisentraut's avatar
      Rework the options syntax for logical replication commands · b807f598
      Peter Eisentraut authored
      For CREATE/ALTER PUBLICATION/SUBSCRIPTION, use similar option style as
      other statements that use a WITH clause for options.
      
      Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      b807f598
    • Andrew Dunstan's avatar
      Avoid tests which crash the calling process on Windows · 734cb4c2
      Andrew Dunstan authored
      Certain recovery tests use the Perl IPC::Run module's start/kill_kill
      method of processing. On at least some versions of perl this causes the
      whole process and its caller to crash. If we ever find a better way of
      doing these tests they can be re-enabled on this platform. This does not
      affect Mingw or Cygwin builds, which use a different perl and a
      different shell and so are not affected.
      734cb4c2
    • Simon Riggs's avatar
      Lag tracking for logical replication · 024711bb
      Simon Riggs authored
      Lag tracking is called for each commit, but we introduce
      a pacing delay to ensure we don't swamp the lag tracker.
      
      Author: Petr Jelinek, with minor pacing delay code from me
      024711bb
  3. 11 May, 2017 3 commits
  4. 10 May, 2017 11 commits
  5. 09 May, 2017 6 commits
  6. 08 May, 2017 2 commits