mem context is not reset between extended stats

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема mem context is not reset between extended stats
Дата
Msg-id 20210915200928.GP831@telsasoft.com
обсуждение исходный текст
Ответы Re: mem context is not reset between extended stats  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
Memory allocation appeared be O(1) WRT the number of statistics objects, which
was not expected to me.  This is true in v13 (and probably back to v10).

It seems to work fine to reset the memory context within the loop, so long as
the statslist is allocated in the parent context.

|DROP TABLE t; CREATE TABLE t AS SELECT i, i+1 AS a, i+2 AS b, i+3 AS c, i+4 AS d, i+5 AS e FROM
generate_series(1,99999)i;

|SELECT format('CREATE STATISTICS sta%s (ndistinct) ON a,(1+b),(2+c),(3+d),(4+e) FROM t', a) FROM
generate_series(1,9)a\gexec
|SET log_statement_stats=on; SET client_min_messages=debug; ANALYZE t;
|=> 369432 kB max resident size

|SELECT format('CREATE STATISTICS sta%s (ndistinct) ON a,b,c,d,e FROM t', a) FROM generate_series(1,33)a\gexec
|SET log_statement_stats=on; SET client_min_messages=debug; ANALYZE t;
|=> 1284368 kB max resident size

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Hook for extensible parsing.
Следующее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Hook for extensible parsing.