jfischoff / tmp-postgres

Create temporary postgres instances
BSD 3-Clause "New" or "Revised" License
53 stars 18 forks source link

Add a `auto_explain` config #229

Closed jfischoff closed 4 years ago

jfischoff commented 4 years ago

Using auto_explain is a nice way to understand what is happening with slow queries. Here is a possible default config

  let opts = [ ("log_min_duration_statement", "9ms")
             , ("shared_preload_libraries", "'auto_explain'")
             , ("session_preload_libraries", "'auto_explain'")
             , ("auto_explain.log_analyze", "1")
             , ("auto_explain.log_buffers", "1")
             , ("auto_explain.log_timing", "1")
             , ("auto_explain.log_triggers", "1")
             , ("auto_explain.log_verbose", "1")
             , ("auto_explain.log_min_duration", "10ms")
             , ("auto_explain.log_nested_statements", "1")
             , ("auto_explain.sample_rate", "1")
             , ("auto_explain.log_level", "WARNING")
             , ("auto_explain.log_verbose", "on")
             , ("log_connections", "off")
             , ("log_disconnections", "off")
             , ("auto_explain.log_format", "json")
             ]