Re: Is a VACUUM or ANALYZE necessary after logical replication?

Поиск
Список
Период
Сортировка
Искать
От
Adrian Klaver
Тема
Re: Is a VACUUM or ANALYZE necessary after logical replication?
Дата
Msg-id
a6f211d1-a44c-4efe-8df2-d132f8f5e1f5@aklaver.com
Ответ на
Список
Дерево обсуждения
Is a VACUUM or ANALYZE necessary after logical replication? Koen De Groote <kdg.dev@gmail.com>
Re: Is a VACUUM or ANALYZE necessary after logical replication? Adrian Klaver <adrian.klaver@aklaver.com>
Re: Is a VACUUM or ANALYZE necessary after logical replication? Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>
Re: Is a VACUUM or ANALYZE necessary after logical replication? "David G. Johnston" <david.g.johnston@gmail.com>
On 6/15/24 15:55, Koen De Groote wrote:
> I've gone over all of 
> https://www.postgresql.org/docs/current/logical-replication.html 
>  and 
> the only mentions of the word "index" I could find was in relation to 
> replica identity and examples of table definitions showing primary key 
> indexes.
> 
> Nothing is said about indexes. Maybe for good reason, maybe they are 
> fully functionality immediately after replication?
> 
> So the main question: Once a table is fully replicated, do I need to 
> vacuum(analyze) that table, or are the indexes on that table already 
> functional?

VACUUM/ANALYZE is not about making the index functional. The VACUUM 
marks the space dead tuples occupy in the table and associated indexes 
as available for recycling. The ANALYZE updates tables statistics to 
help the planner make decisions on what query plan to use. On a fresh 
table VACUUM will not be of much value, ANALYZE though will help by 
creating up to date table statistics.

> 
> Regards,
> Koen De Groote

-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления
От: Koen De Groote
Дата:
От: Laurenz Albe
Дата:
FAQ