Jump to content
php.lv forumi

dzēst daudz datu no PostgreSQL tabulas


mmk

Recommended Posts

kad daudz datu dzēš no mysql, tad ir jāpalaiž komanda optimize, kad tabulu pārindeksē un samazinā izmērus.

 

postgresql ir kaut kas tāds līdzīgs? neesmu neko atradis.

un pieredze rāda, ka dzēšot daudz datu ieks psql, tabulas un indeksa izmērs automātiski nemainās..

Link to comment
Share on other sites

PostgreSQL-am ir tāda lieta kā VACUUM. Domāju, ka tas pats vien ir, tikai citādi nosaukts. =)

 

Running VACUUM recommended

The estimated rowcount on the table "access" deviates significantly from the actual rowcount. You should run VACUUM ANALYZE on this table. 
Instead of issuing a manual VACUUM ANALYZE command on this table (you can use the pgAdmin III maintenance menu for this), running VACUUM ANALYZE on a regular or automated basis should be considered. This can be achieved using a scheduler. PostgreSQL also supplies the pg_autovacuum daemon, which will track changes made to the database and issue vacuum commands as required automatically. In most cases, pg_autovacuum will be the best choice. 

What is VACUUM good for? 

The PostgreSQL query planner makes its decision based on assumptions, taken from the estimated rowcount. If the actual rowcount is too different from the estimated rowcount, the planner might take a wrong decision, resulting in a query plan that is not optimal. This might result in poor performance. 
The PostgreSQL storage needs VACUUM to have transaction IDs in tables fixed. Additionally, outdated rows from updates and deletes are not cleaned up until the VACUUM command has been issued on that table. In-depth information can be found in the online documentation, just press the help button.

 

Un vēl ir tāda lieta, kā Reindex.

Edited by GedroX
Link to comment
Share on other sites

×
×
  • Create New...