Here are few questions with respect to Indexing in the Postgres database
1.How to reclaim the index space that is no longer in use??
2.What will reindexing of index do??
3.How to find the corrupted index on my database?
In postgres there is no concept of analyzing the index only analyzing the tables is available.
Ex:analyze table tablename;
we will get info on running the above query regarding any index corruption if it has happened .
Ouput on running the above query:
INFO: analyzing "public.mr_regisration_header"
INFO: "mr_regisration_header": scanned 3000 of 16958 pages, containing 146920 live rows and 1 dead rows; 3000 rows in sample, 830490 estimated total rows
Index corrpution mainly occur because of 2 reasons.
1.Sofware bugs 2.Hardware issues
Corrupted index can be reclaimed by the following command ---
reindex indexname
Reindexing provides a recovery method for reclaiming the index.
Reindexing rebuilds the index uisng data stored in the Index's table,replacing the old copy of the index.
My Space
Hang over--Wrath of Grapes
No comments:
Post a Comment