Re: Does CLUSTER generate WAL data?

Поиск
Список
Период
Сортировка
От Craig James
Тема Re: Does CLUSTER generate WAL data?
Дата
Msg-id CAFwQ8rcS-eT_oNWZPOZeKbAkSFjkTvpU8NiUDK6kEWaZ5byjbA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Does CLUSTER generate WAL data?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Does CLUSTER generate WAL data?  (Scott Ribe <scott_ribe@elevated-dev.com>)
Список pgsql-admin


On Wed, Aug 24, 2016 at 4:49 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Aug 24, 2016 at 7:06 PM, Craig James <cjames@emolecules.com> wrote:
I know the CLUSTER command essentially creates a new table, copies the data in INDEX order, then deletes the original table.

Does that mean all of the data passes through the WAL logs, or is it purely an internal operation? More specifically, if we're doing streaming replication, will all of the data for the table being clustered be transmitted across the network to the hot-standby slave?


Not looking at the code but, yes, the replica must be an exact physical duplicate of the master and since the only ongoing source of data for the replica is the WAL the actions taken as part of performing a CLUSTER must be logged.

Right, I understand that the WAL has to record the operation. But I'm not sure that answers the question. If the contents of the WAL are, "copy this table to that table in index order", then no data from the table itself will be in the WAL. On the other hand, if the contents of the WAL are "create a new table, and then insert all of this data", then the WAL records will be huge.

Which is it?

Thanks,
Craig


David J.




--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Does CLUSTER generate WAL data?
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Does CLUSTER generate WAL data?