Index file is growing when I drop a table. Why?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Index file is growing when I drop a table. Why?
Date: 2023-11-16 16:32:26
Message-ID: CANzqJaBZLxdF+057oKo468nu7nq0jr+6tyOcTM-P6Cy+3kh3jQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Pg 15.4

I'm dropping the large table "bar" in a test database, and it's taking a
*long* time. Thus, I thought I'd watch it deleting files.

To my surprise, though, the files that store the index are growing. What's
up with that?

foo=# select * from pg_class where oid = 41533;
-[ RECORD 1 ]-------+----------
oid | 41533
relname | i_bar_su1
relnamespace | 2200

$ pwd
/var/lib/pgsql/15/data/base/16482
$ la -aFl 41533*
-rw------- 1 postgres postgres 1073741824 2023-11-16 11:15:06 41533
-rw------- 1 postgres postgres 189792256 2023-11-16 11:24:15 41533.1

Five minutes later, 41533.1 is 4.3MB larger.

$ dir 41533*
-rw------- 1 postgres postgres 1073741824 2023-11-16 11:15:06 41533
-rw------- 1 postgres postgres 194101248 2023-11-16 11:29:44 41533.1

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios 2023-11-16 17:22:20 Re: Index file is growing when I drop a table. Why?
Previous Message Ron Johnson 2023-11-16 16:20:51 Re: bulk DMLs