Re: REINDEX vs VACUUM

2023-01-05 Thread Peter J. Holzer
On 2023-01-05 12:34:08 +0100, Karsten Hilbert wrote: > > Von: "Peter J. Holzer" > > On 2023-01-04 09:34:42 -0600, Ron wrote: > > > I don't think VACUUM FULL (copy the table, create new indices and other > > > metadata all in one command) actually vacuums tables.  It's a misleading > > > name. > >

Aw: Re: REINDEX vs VACUUM

2023-01-05 Thread Karsten Hilbert
> Von: "Peter J. Holzer" > On 2023-01-04 09:34:42 -0600, Ron wrote: > > I don't think VACUUM FULL (copy the table, create new indices and other > > metadata all in one command) actually vacuums tables.  It's a misleading > > name. > > Move all the stuff from the living room to the bedroom and the

Re: REINDEX vs VACUUM

2023-01-05 Thread Peter J. Holzer
On 2023-01-04 09:34:42 -0600, Ron wrote: > I don't think VACUUM FULL (copy the table, create new indices and other > metadata all in one command) actually vacuums tables.  It's a misleading > name. Move all the stuff from the living room to the bedroom and then jettison the living room. Isn't tha

Re: REINDEX vs VACUUM

2023-01-05 Thread Brad White
On 1/4/2023 9:34 AM, Ron wrote: I don't think VACUUM FULL (copy the table, create new indices and other metadata all in one command) actually vacuums tables.  It's a misleading name. Something like REBUILD TABLE would be a better name. Well s***. That explains a lot. Thanks for clearing th

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
I have looked more into it and have found that VACUUM FULL (and CLUSTER) does in fact rebuild indexes, see for example: https://github.com/postgres/postgres/blob/c8e1ba736b2b9e8c98d37a5b77c4ed31baf94147/src/backend/commands/cluster.c#L1463 I have also run some tests and have come to understand

Re: REINDEX vs VACUUM

2023-01-04 Thread Ron
I don't think VACUUM FULL (copy the table, create new indices and other metadata all in one command) actually vacuums tables.  It's a misleading name. Something like REBUILD TABLE would be a better name. On 1/4/23 07:25, Rébeli-Szabó Tamás wrote: Here is my understanding: REINDEX recreates th

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
Here is my understanding: REINDEX recreates the index from scratch, using the data stored in the underlying table. It is the same as dropping and recreating the index manually, with regard to the impact on the index file. It can free up physical space in the file system. REINDEX will not vacuu

Re: REINDEX vs VACUUM

2023-01-04 Thread Hao Zhang
+ pgsql-admin Would appreciate any insights. Thanks On Sat, Dec 31, 2022 at 1:04 PM Hao Zhang wrote: > 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 in

REINDEX vs VACUUM

2022-12-31 Thread Hao Zhang
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