1. 12 Nov, 2019 7 commits
  2. 11 Nov, 2019 8 commits
  3. 09 Nov, 2019 6 commits
  4. 08 Nov, 2019 6 commits
  5. 07 Nov, 2019 9 commits
  6. 06 Nov, 2019 4 commits
    • Tomas Vondra's avatar
      Allow sampling of statements depending on duration · 6e3e6cc0
      Tomas Vondra authored
      This allows logging a sample of statements, without incurring excessive
      log traffic (which may impact performance).  This can be useful when
      analyzing workloads with lots of short queries.
      
      The sampling is configured using two new GUC parameters:
      
       * log_min_duration_sample - minimum required statement duration
      
       * log_statement_sample_rate - sample rate (0.0 - 1.0)
      
      Only statements with duration exceeding log_min_duration_sample are
      considered for sampling. To enable sampling, both those GUCs have to
      be set correctly.
      
      The existing log_min_duration_statement GUC has a higher priority, i.e.
      statements with duration exceeding log_min_duration_statement will be
      always logged, irrespectedly of how the sampling is configured. This
      means only configurations
      
        log_min_duration_sample < log_min_duration_statement
      
      do actually sample the statements, instead of logging everything.
      
      Author: Adrien Nayrat
      Reviewed-by: David Rowley, Vik Fearing, Tomas Vondra
      Discussion: https://postgr.es/m/bbe0a1a8-a8f7-3be2-155a-888e661cc06c@anayrat.info
      6e3e6cc0
    • Tomas Vondra's avatar
      Document log_transaction_sample_rate as superuser-only · 11d9ac28
      Tomas Vondra authored
      The docs do say which GUCs can be changed only by superusers, but we
      forgot to mention this for the new log_transaction_sample_rate. This
      GUC was introduced in PostgreSQL 12, so backpatch accordingly.
      
      Author: Adrien Nayrat
      Backpatch-through: 12
      11d9ac28
    • Tom Lane's avatar
      Minor code review for tuple slot rewrite. · 22e44e8d
      Tom Lane authored
      Avoid creating transiently-inconsistent slot states where possible,
      by not setting TTS_FLAG_SHOULDFREE until after the slot actually has
      a free'able tuple pointer, and by making sure that we reset tts_nvalid
      and related derived state before we replace the tuple contents.  This
      would only matter if something were to examine the slot after we'd
      suffered some kind of error (e.g. out of memory) while manipulating
      the slot.  We typically don't do that, so these changes might just be
      cosmetic --- but even if so, it seems like good future-proofing.
      
      Also remove some redundant Asserts, and add a couple for consistency.
      
      Back-patch to v12 where all this code was rewritten.
      
      Discussion: https://postgr.es/m/16095-c3ff2e5283b8dba5@postgresql.org
      22e44e8d
    • Tom Lane's avatar
      Sync our DTrace infrastructure with c.h's definition of type bool. · ff43b3e8
      Tom Lane authored
      Since commit d26a810e, we've defined bool as being either _Bool from
      <stdbool.h>, or "unsigned char"; but that commit overlooked the fact
      that probes.d has "#define bool char".  For consistency, make it say
      "unsigned char" instead.  This should be strictly a cosmetic change,
      but it seems best to be in sync.
      
      Formally, in the now-normal case where we're using <stdbool.h>, it'd
      be better to write "#define bool _Bool".  However, then we'd need
      some build infrastructure to inject that configuration choice into
      probes.d, and it doesn't seem worth the trouble.  We only use
      <stdbool.h> if sizeof(_Bool) is 1, so having DTrace think that
      bool parameters are "unsigned char" should be close enough.
      
      Back-patch to v12 where d26a810e came in.
      
      Discussion: https://postgr.es/m/CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com
      ff43b3e8