pgsql: Save a few cycles while creating "sticky" entries in pg_stat_sta

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Save a few cycles while creating "sticky" entries in pg_stat_sta
Дата
Msg-id E1SHGKE-00062U-H4@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Save a few cycles while creating "sticky" entries in pg_stat_statements.

There's no need to sit there and increment the stats when we know all the
increments would be zero anyway.  The actual additions might not be very
expensive, but skipping acquisition of the spinlock seems like a good
thing.  Pushing the logic about initialization of the usage count down into
entry_alloc() allows us to do that while making the code actually simpler,
not more complex.  Expansion on a suggestion by Peter Geoghegan.

Branch
------
master

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

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |   81 ++++++++---------------
1 files changed, 28 insertions(+), 53 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Remove link to ODBCng project from the docs.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Don't bother copying empty support arrays in a zero-column Merge