pg_squeeze | A PostgreSQL extension for automatic bloat cleanup
kandi X-RAY | pg_squeeze Summary
kandi X-RAY | pg_squeeze Summary
pg_squeeze is an extension that removes unused space from a table and optionally sorts tuples according to particular index (as if CLUSTER [2] command was executed concurrently with regular reads / writes). In fact we try to replace pg_repack [1] extension. While providing very similar functionality, pg_squeeze takes a different approach as it. While 1) makes both configuration and use simpler (compared to [1] which uses both server and client side code), it also allows for rather smooth implementation of unattended processing using background workers [3]. As for 2), one important difference (besides the use of background workers) is that we use logical decoding [4] instead of triggers to capture concurrent changes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pg_squeeze
pg_squeeze Key Features
pg_squeeze Examples and Code Snippets
Community Discussions
Trending Discussions on pg_squeeze
QUESTION
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.
...ANSWER
Answered 2022-Feb-11 at 09:22The main difference is that pg_queeze 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pg_squeeze
Set PG_CONFIG environment variable to point to pg_config command of your PostgreSQL installation.
make
sudo make install
Apply the following settings to postgresql.conf: wal_level = logical max_replication_slots = 1 # ... or add 1 to the current value. shared_preload_libraries = 'pg_squeeze' # ... or add the library to the existing ones.
Start the PG cluster.
As a superuser, run CREATE EXTENSION pg_squeeze;
CAUTION! As there's no straightforward way to migrate the scheduling information (see the notes on the "schedule" column of the "squeeze"."tables" table) automatically, and as the "schedule" column must not contain NULL values, the upgrade deletes the contents of the "squeeze"."tables" table. Please export the table contents to a file before you perform the upgrade and configure the checks of those tables again as soon as the upgrade is done.
Set PG_CONFIG environment variable to point to pg_config command of your PostgreSQL installation.
make
Stop the PG instance
sudo make install
Restart the PG instance
Connect to each database containing pg_squeeze 1.2.x and run this command: ALTER EXTENSION pg_squeeze UPDATE;
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page