REINDEX vs VACUUM

From: Hao Zhang <kennthhz(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: REINDEX vs VACUUM
Date: 2022-12-31 21:04:33
Message-ID: CAGXpB2nN=CGRDnQN94iB_oZOUYa76CP-EXjzqyuCxjYnpphWdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What is the difference between reindex and vacuum's impact on index file? I
deleted an indexed row. Running either vacuum or reindex shows the index
entry for the row is removed from the index page. I was under the
impression that only reindex will remove dangling index entries. I am
guessing that vacuum will not shrink the index file and will only add
deleted index entries in the free space file for the index? But REINDEX is
recreating the index file from scratch so it is like vacuum full for index?

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Antonis Christodoulou 2023-01-01 20:51:27 PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours
Previous Message Rushikesh socha 2022-12-31 17:26:59 Re: Exact same output - pg_stat_statements