I have 9 million lines of table. I came to know that a large amount of it (about 90%) can be freed What tasks are required after up-to-date? Thanks in advance.
If you want to free up space on the file system, either vacuum full or cluster help you You can also make sure that the planer has the latest data, still you want to run ANALYZE. Your tables will be completely closed during this process (this book reads and writes in this table), so you probably want to take your application for offline.
PostgreSQL 8.2 and earlier, vacuum full probably your best bet.
In PostgreSQL 8.3 and 8.4, the CLUSTER command has improved significantly, so vacuum full is not recommended - it is slow and it will blot your indexes to cluster scratches And again without indexing the bloat. In my experience it is usually very fast, CLUSTER will sort the entire physical table using the additional index, so you have to choose an index if you do not know if the primary key will work properly. In PostgreSQL 9.0, vacuum full was changed to work like a cluster, so both are good. It is difficult to make predictions, but on a properly tuned server with commodity hardware, 9 million rows should not take more than 20 minutes.
Comments
Post a Comment