Skip to content

Instantly share code, notes, and snippets.

@davetapley
Created October 25, 2012 20:40
Show Gist options
  • Save davetapley/3955255 to your computer and use it in GitHub Desktop.
Save davetapley/3955255 to your computer and use it in GitHub Desktop.
VACCUM VERBOSE
=> VACUUM VERBOSE location_events;
INFO: vacuuming "public.location_events"
INFO: scanned index "location_events_pkey" to remove 3882346 row versions
DETAIL: CPU 0.91s/7.16u sec elapsed 13.93 sec.
INFO: scanned index "index_location_events_on_user_id" to remove 3882346 row versions
DETAIL: CPU 1.68s/9.01u sec elapsed 21.61 sec.
INFO: scanned index "index_location_events_on_user_id_where_not_archived" to remove 3882346 row versions
DETAIL: CPU 0.00s/1.70u sec elapsed 1.66 sec.
INFO: "location_events": removed 3882346 row versions in 92228 pages
DETAIL: CPU 0.21s/1.98u sec elapsed 8.32 sec.
INFO: index "location_events_pkey" now contains 31860559 row versions in 100034 pages
DETAIL: 3226521 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: index "index_location_events_on_user_id" now contains 31860559 row versions in 105322 pages
DETAIL: 3881943 index row versions were removed.
2806 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: index "index_location_events_on_user_id_where_not_archived" now contains 2461237 row versions in 13379 pages
DETAIL: 1294908 index row versions were removed.
570 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: "location_events": found 3291 removable, 31860559 nonremovable row versions in 577538 out of 577538 pages
DETAIL: 0 dead row versions cannot be removed yet.
There were 2481 unused item pointers.
0 pages are entirely empty.
CPU 11.18s/25.66u sec elapsed 118.49 sec.
VACUUM
@davetapley
Copy link
Author

index_location_events_on_user_id_where_not_archived is the partial index in question.

index_location_events_on_user_id is a full index on the same field, which I am about to drop in favor of the partial version.

This VACUUM was run immediately after setting archived = true to approximately 2 days worth of events which were previously archived = false (those older than 3, but newer than 5 days old).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment