Re: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches - Mailing list pgsql-general

From Christophe Pettus
Subject Re: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches
Date
Msg-id DC283F75-96B6-4BD6-844F-D0B1A47666E6@thebuild.com
Whole thread Raw
In response to Re: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches  (Dimitrios Apostolou <jimis@gmx.net>)
List pgsql-general

> On Jan 31, 2023, at 07:40, Dimitrios Apostolou <jimis@gmx.net> wrote:
> Is this bloat even affecting queries that do not use the index?

No, but a bloated index often (although not always) goes along with a bloated table.

> It seems I have to add VACUUM FULL to nightly maintainance.

I wouldn't go that far; that's basically changing your oil every time you get gas.  However, monitoring bloat and
eitherrebuilding the indexes (if they're all that's bloated) or using pg_repack [1] periodically is a good practice. 

[1] https://github.com/reorg/pg_repack


pgsql-general by date:

Previous
From: Dimitrios Apostolou
Date:
Subject: Re: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches
Next
From: "David G. Johnston"
Date:
Subject: Re: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches