Обсуждение: PG13 Autovacuum for Insert
Hi all,
In PG13, we have a new feature where autovacuum gets triggered based on Insert threshold. I wanted to know why we need autovacuum for Insert workloads, as there won't be any dead tuples because of them and we already have Auto analyze for inserts till PG12.
Thanks,
Raj Kumar Narendiran
On Thu, Jul 8, 2021 at 8:27 AM Raj kumar <rajkumar820999@gmail.com> wrote:
Hi all,In PG13, we have a new feature where autovacuum gets triggered based on Insert threshold. I wanted to know why we need autovacuum for Insert workloads, as there won't be any dead tuples because of them and we already have Auto analyze for inserts till PG12.Thanks,Raj Kumar Narendiran
Vacuum also keeps the freespacemap and visibility maps updated as well. Not quite as critical for insert-only tables, but it can still influence query planning. Having an up to date visibility-map can help index-only scans happen more frequently if possible.
--
This section of the documentation is a really good read for understanding vacuuming and MVCC in PostgreSQL.
On 7/8/21 8:38 AM, Keith Fiske wrote: [snip] > Vacuum also keeps the freespacemap and visibility maps updated as well. > Not quite as critical for insert-only tables, but it can still influence > query planning. Having an up to date visibility-map can help index-only > scans happen more frequently if possible. We've got INSERT-only tables, and the query planner only used sequential scans (on a freshly loaded 6TB database) until I vacuumed all tables, -- Angular momentum makes the world go 'round.
Thanks Keith and Ron. Now, I understood better.
Thanks,
Raj Kumar Narendiran.
On Thu, 8 Jul 2021, 20:29 Ron, <ronljohnsonjr@gmail.com> wrote:
On 7/8/21 8:38 AM, Keith Fiske wrote:
[snip]
> Vacuum also keeps the freespacemap and visibility maps updated as well.
> Not quite as critical for insert-only tables, but it can still influence
> query planning. Having an up to date visibility-map can help index-only
> scans happen more frequently if possible.
We've got INSERT-only tables, and the query planner only used sequential
scans (on a freshly loaded 6TB database) until I vacuumed all tables,
--
Angular momentum makes the world go 'round.