Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a
Дата
Msg-id 20200712142921.GA26220@telsasoft.com
обсуждение исходный текст
Ответ на Avoid useless retrieval of defaults and check constraints in pg_dump -a  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Avoid useless retrieval of defaults and check constraints in pg_dump -a  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
On Sun, Jul 12, 2020 at 07:48:50AM +0200, Julien Rouhaud wrote:
> Currently, getTableAttrs() always retrieves info about columns defaults and
> check constraints, while this will never be used if --data-only option if used.
> This seems like a waste of resources, so here's a patch to skip those parts
> when the DDL won't be generated.

Note that the speed of default and constraint handling has come up before:

https://www.postgresql.org/message-id/flat/CAMkU%3D1xPqHP%3D7YPeChq6n1v_qd4WGf%2BZvtnR-b%2BgyzFqtJqMMQ%40mail.gmail.com
https://www.postgresql.org/message-id/CAMkU=1x-e+maqefhM1yMeSiJ8J9Z+SJHgW7c9bqo3E3JMG4iJA@mail.gmail.com

I'd pointed out that a significant fraction of our pg_upgrade time was in
pg_dump, due to having wide tables with many child tables, and "default 0" on
every column.  (I've since dropped our defaults so this is no longer an issue
here).

It appears your patch would avoid doing unnecessary work in the --data-only
case, but it wouldn't help the pg_upgrade case.

-- 
Justin



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: calling procedures is slow and consumes extra much memory against calling function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Improving psql slash usage help message