Re: improve performance of pg_dump with many sequences

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: improve performance of pg_dump with many sequences
Дата
Msg-id ZpiP3I6UVcgsCCWf@nathan
обсуждение исходный текст
Ответ на Re: improve performance of pg_dump with many sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: improve performance of pg_dump with many sequences
Список pgsql-hackers
Here is an attempt at adding a new function that returns the sequence tuple
and using that to avoid querying each sequence relation individually in
dumpSequenceData().

If we instead wanted to change pg_sequence_last_value() to return both
is_called and last_value, I think we could modify the pg_sequences system
view to use a LATERAL subquery, i.e.,

    SELECT
        ...
        CASE
            WHEN L.is_called THEN L.last_value
            ELSE NULL
        END AS last_value
    FROM pg_sequence S
        ...
        JOIN LATERAL pg_sequence_last_value(S.seqrelid) L ON true
    ...

That doesn't seem so bad, and it'd avoid an extra pg_proc entry, but it
would probably break anything that calls pg_sequence_last_value() directly.
Thoughts?

-- 
nathan

Вложения

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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: SQL:2011 application time
Следующее
От: shveta malik
Дата:
Сообщение: Re: Allow logical failover slots to wait on synchronous replication