Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

instrument.c

  • Tom Lane's avatar
    0e23588e
    Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF). · 0e23588e
    Tom Lane authored
    Commit af7914c6, which added the TIMING
    option to EXPLAIN, had an oversight: if the TIMING option is disabled
    then control in InstrStartNode() goes through an elog(DEBUG2) call, which
    typically does nothing but takes a noticeable amount of time to do it.
    Tweak the logic to avoid that.
    
    In HEAD, also change the elog(DEBUG2)'s in instrument.c to elog(ERROR).
    It's not very clear why they weren't like that to begin with, but this
    episode shows that not complaining more vociferously about misuse is
    likely to do little except allow bugs to remain hidden.
    
    While at it, adjust some code that was making possibly-dangerous
    assumptions about flag bits being in the rightmost byte of the
    instrument_options word.
    
    Problem reported by Pavel Stehule (via Tomas Vondra).
    0e23588e
    History
    Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).
    Tom Lane authored
    Commit af7914c6, which added the TIMING
    option to EXPLAIN, had an oversight: if the TIMING option is disabled
    then control in InstrStartNode() goes through an elog(DEBUG2) call, which
    typically does nothing but takes a noticeable amount of time to do it.
    Tweak the logic to avoid that.
    
    In HEAD, also change the elog(DEBUG2)'s in instrument.c to elog(ERROR).
    It's not very clear why they weren't like that to begin with, but this
    episode shows that not complaining more vociferously about misuse is
    likely to do little except allow bugs to remain hidden.
    
    While at it, adjust some code that was making possibly-dangerous
    assumptions about flag bits being in the rightmost byte of the
    instrument_options word.
    
    Problem reported by Pavel Stehule (via Tomas Vondra).