Re: does pg_restore respect CLUSTER ON in the schema?

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: does pg_restore respect CLUSTER ON in the schema?
Дата
Msg-id 1415315762292-5826009.post@n5.nabble.com
обсуждение исходный текст
Ответ на does pg_restore respect CLUSTER ON in the schema?  (Seth Pollack <seth@pollackphoto.com>)
Список pgsql-general
Seth Pollack wrote
> I have a database where several tables have been physically clustered on
> disk. Those clustering configuration parameters are stored in the schema
> (via ALTER TABLE mytable CLUSTER ON myindex).
>
> My question is, when i restore a backup of this database using pg_restore,
> is it restored with that physical clustering, or without? i.e. do i need
> to run a cluster command immediately after the restore, or is it already
> done?

Some assuming here...

The COPY command that pg_dump uses will use a sequential scan over the table
and return tuples as it encounters them.  Upon restore the COPY will see
those records in the source file in the same order and should insert them
onto disk without shuffling.

A sequential scan should cause the copy output to remain in cluster order
for records that were previously clustered (keeping in mind MVCC mechanics)
while any newer ones will likely be in actual insert order.  The restored
database should have a similar layout and thus the need to perform
clustering would be dependent upon when you last ran cluster on the source
database.

David J.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/does-pg-restore-respect-CLUSTER-ON-in-the-schema-tp5826007p5826009.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: does pg_restore respect CLUSTER ON in the schema?
Следующее
От: pbj@cmicdo.com
Дата:
Сообщение: Re: Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)