pgsql: Limit overall indentation in rule/view dumps.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Limit overall indentation in rule/view dumps.
Дата
Msg-id E1WfXgK-0006PU-BG@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Limit overall indentation in rule/view dumps.

Continuing to indent no matter how deeply nested we get doesn't really
do anything for readability; what's worse, it results in O(N^2) total
whitespace, which can become a performance and memory-consumption issue.

To address this, once we get past 40 characters of indentation, reduce
the indentation step distance 4x, and also limit the maximum indentation
by reducing it modulo 40.  This latter choice is a bit weird at first
glance, but it seems to preserve readability better than a simple cap
would do.

Back-patch to 9.3, because since commit 62e666400d the performance issue
is a hazard for pg_dump.

Greg Stark and Tom Lane

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   |   28 ++++-
src/test/regress/expected/rules.out |  228 +++++++++++++++++------------------
2 files changed, 140 insertions(+), 116 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Limit overall indentation in rule/view dumps.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Reduce indentation/parenthesization of set operations in rule/vi