vitabaks / pg_auto_reindexer Goto Github PK
View Code? Open in Web Editor NEWAutomatic reindexing of B-tree indexes (bloat cleanup)
License: MIT License
Automatic reindexing of B-tree indexes (bloat cleanup)
License: MIT License
At the moment, the script stops if it fails to take the lock during the specified lock_timeout
2022-12-05 14:15:46 INFO: completed repack index public.access_person_user_id_key (size after: 1 MB)
2022-12-05 14:15:49 INFO: repack index public.idx_to_repack (size: 3 MB)
2022-12-05 14:15:50 WARN: WARNING: Error creating index "public"."index_17767": ERROR: canceling statement due to lock timeout
2022-12-05 14:16:00 INFO: [retry 1/3] repack index public.idx_to_repack (size: 3 MB)
2022-12-05 14:16:00 WARN: WARNING: Cannot create index "public"."index_17767", already exists
2022-12-05 14:16:30 INFO: [retry 2/3] repack index public.idx_to_repack (size: 3 MB)
2022-12-05 14:16:30 WARN: WARNING: Cannot create index "public"."index_17767", already exists
2022-12-05 14:17:30 INFO: [retry 3/3] repack index public.idx_to_repack (size: 3 MB)
2022-12-05 14:17:30 WARN: WARNING: Cannot create index "public"."index_17767", already exists
2022-12-05 14:17:30 WARN: failed to repack index "public.idx_to_repack" after all attempts. Skipping
2022-12-05 14:17:30 INFO: repack index public.another_idx_to_repack (size: 3 MB)
2022-12-05 14:17:30 INFO: completed repack index public.another_idx_to_repack (size after: 2 MB)
2022-12-05 14:17:30 WARN: A temporary index apparently created by pg_repack has been left behind, and we do not want to risk dropping this index ourselves. If the index was in fact created by an old pg_repack job which didn't get cleaned up, you should just use DROP INDEX CONCURRENTLY and try the pg_auto_reindexer again.
2022-12-05 14:17:30 WARN: invalid indexes: public.index_17767
2022-12-05 14:17:30 INFO: Total amount released during maintenance: 0 MB
Code seems to work without issues as expected, but probably need to change behaviour in case of pg_repack.
Options:
I have my pg_hba.conf configured in the way that superuser can only connect via peer auth and local unix socket. So that feature is highly desirable.
pg_auto_reindexer attempts to process pg_catalog indexes:
root@hostname:~# pg_auto_reindexer --dbname=dbname --index_bloat=80
2021-04-27 23:54:16 INFO: Start index maintenance for database: dbname
2021-04-27 23:54:17 INFO: repack index pg_catalog.pg_attribute_relid_attnum_index
2021-04-27 23:54:19 INFO: repack index pg_catalog.pg_depend_reference_index
2021-04-27 23:54:21 INFO: repack index pg_catalog.pg_depend_depender_index
...
I suppose they should be ignored.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.