2

I've been working on optimizing tables in database. One of our table requires monthly vacuuming because of cleaning up processes.pg_squeeze Table size can get upto 25 GB. As this table is used by production users, we can't afford downtime every month to run VACUUM FULL.

I found that pg_squeeze and pg_repack can be used for this purpose. But I'm not able to understand the difference between those two. Can someone please explain what is the difference and which will be more suitable for me to use?

Thank you.

vivekpadia70
  • 1,039
  • 3
  • 10
  • 30
  • [Quote from the pg_squeeze readme](https://github.com/cybertec-postgresql/pg_squeeze#readme) "*In fact we try to replace pg_repack [1] extension.*" - so they see themselves as a successor to pg_repack –  Feb 11 '22 at 08:59

2 Answers2

7

The main difference is that pg_squeeze operates entirely inside the database, with no need for an external binary. It also has a background worker that will schedule table rewrites automatically if certain criteria are met.

So you could say that pg_repack is less invasive (for example, installation requires no restart of the database), but pg_squeeze is more feature complete.

Disclaimer: I work for the company who wrote pg_squeeze.

David Rawson
  • 20,912
  • 7
  • 88
  • 124
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
2

Thanks for the question, was just searching for the same.

There's a point that might influence one's decision - extension support when running on managed db. For example AWS RDS supports pg_repack but not pg_squeeze.

Vilda
  • 41
  • 3
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 21 '22 at 19:41
  • What's unclear about what was written? AWS supports pg_repack but does not support pg_squeeze - what's difficult about that? – Vérace Jul 05 '23 at 06:52