1. 13 Nov, 2019 1 commit
  2. 12 Nov, 2019 9 commits
  3. 11 Nov, 2019 8 commits
  4. 09 Nov, 2019 6 commits
  5. 08 Nov, 2019 6 commits
  6. 07 Nov, 2019 9 commits
  7. 06 Nov, 2019 1 commit
    • 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