1

A table is containing 300mB of bloat. It's a few less than 20% of the table records. The autovaccum is about to clean it in a few days, when it's maybe 350-400mB. Disk space is not a problem.

What is the impact for my production to have this bloat? It seems it should be evicted from cache since it's not queried, but is the bloat in RAM too?

Does it affect the latency, cpu usage or anything other than the space on disk?

1
  • Is the bloat all gathered together in a contiguous range of empty pages, or scattered amongst the live data?
    – jjanes
    Apr 13, 2022 at 22:20

1 Answer 1

2

That amount of bloat is no problem, it is the “wriggle room” a healthy table needs.

In general, the impact of bloat on your database is:

  • it wastes disk space

  • it slows down sequential scans (but not index scans)

  • it wastes RAM used for caching empty space

4
  • Do not wasting ram is a critical point for us. Is it untrue that bloat is evicted from RAM quickly since it's not queried?
    – Slim
    Apr 13, 2022 at 6:31
  • 1
    Not necessarily. If a block is all empty, it will only be cached during a sequential scan. But a block with only a single row might be stuck in cache if it contains a busy row. Apr 13, 2022 at 6:40
  • Does a busy row means a row which is often queried?
    – Slim
    Apr 13, 2022 at 20:16
  • 1
    That's what I meant. Apr 14, 2022 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.