Re: CHECK constraints in pg_dump

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CHECK constraints in pg_dump
Дата
Msg-id 29444.1046271248@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CHECK constraints in pg_dump  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Ответы Re: CHECK constraints in pg_dump  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
>> Why would there be any speed advantage?

> Is it not faster to add it when all the data is there, rather than
> evaluating it as each row is inserted, like indexes?

I don't see why.  There are good algorithmic reasons why bulk-loading
an index is faster than retail insertions --- mainly that btree goes
out of its way to make it so, with a special code path.  But I see
no reason why checking a constraint expression is going to be any
faster as a post-pass than when done while loading the data.  If
anything, I'd guess it to be slower because you have to re-read the
table.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: autocommit off mode, how does it work?
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Can pessimistic locking be emulated?