pgsql: Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).
Дата
Msg-id E1U3f1a-0007YS-Jt@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).

Commit af7914c6627bcf0b0ca614e9ce95d3f8056602bf, 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).

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bcc6c4c2914ab4f9a39e4a6673f9b6c36ad93914

Modified Files
--------------
src/backend/executor/instrument.c |   24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix performance issue in EXPLAIN (ANALYZE, TIMING OFF).
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: doc: Rewrite how to get the source code