Vacuum وautovacuum
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
explain what vacuum does and why to keep autovacuum on.
الموضوعات المخطط لها
- An
UPDATEwrites a new row version and marks the old one dead;DELETEmarks it dead. VACUUMmarks dead versions reusable, updates the visibility map, and freezes old transaction ids.- Autovacuum runs it automatically when enough rows change; tune per table for hot tables.
- Plain
VACUUMdoes not shrink the file;VACUUM FULLdoes but takes an exclusive lock. - Never disable autovacuum; fix its settings instead.
تفاصيل المخطط المبدئي
عرض عملي
SELECT relname, n_dead_tup, last_autovacuum FROM pg_stat_user_tables ORDER BY n_dead_tup DESC;
اختبر فهمك
Why does an UPDATE need vacuum later?
أظهر الإجابة
It leaves the old row version behind as a dead tuple.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.