Re: Make deparsing of column defaults faster

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Make deparsing of column defaults faster
Дата
Msg-id 06e4481d-fadb-5086-db59-78ae888e07de@2ndquadrant.com
обсуждение исходный текст
Ответ на Make deparsing of column defaults faster  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: Make deparsing of column defaults faster  (Jeff Janes <jeff.janes@gmail.com>)
Re: Make deparsing of column defaults faster  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On 6/4/18 20:55, Jeff Janes wrote:
> The user docs say about column defaults: "The value is any variable-free
> expression (subqueries and cross-references to other columns in the
> current table are not allowed)"
> 
> And also say about pg_get_expr "If the expression might contain Vars,
> specify the OID of the relation they refer to as the second parameter;
> if no Vars are expected, zero is sufficient"
> 
> Since defaults can't contain Vars, this patch converts the second
> parameter to zero in places where pg_get_expr is invoked on column
> defaults.

My in-progress generated columns patch removes that assumption (since a
generated column generally refers to another column of the same table).

> Doing this drops the time needed to run `pg_dump -s` on a
> 1600 column table with defaults on all columns by a factor of 40.  So
> pg_upgrade users with such tables should see a big win (cc Justin).

That's impressive but also a bit disturbing.  Where does this
performance change come from?  Can we harness it in different ways?

> I have not tested the pg_upgrade using source versions <8.4, because I
> can't get anything that old to "make check" correctly, so I have nothing
> to test on.

If you have trouble getting older PostgreSQL versions to run, try
building with -O0.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Make deparsing of column defaults faster
Следующее
От: David Rowley
Дата:
Сообщение: Re: Spilling hashed SetOps and aggregates to disk