التضخم والمعاملات الطويلة
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
find bloat and the long transactions that cause it.
الموضوعات المخطط لها
- Bloat is dead space in tables or indexes that vacuum cannot reuse fast enough; it slows scans and wastes disk.
- Vacuum can only remove versions no transaction might still need; an old open snapshot holds the cleanup horizon back.
- Idle-in-transaction sessions are the usual cause, often from application code that opens a transaction and then calls a slow service.
- Protect with
idle_in_transaction_session_timeoutand short transactions.
تفاصيل المخطط المبدئي
عرض عملي
SELECT pid, state, xact_start, now() - xact_start AS age, query
FROM pg_stat_activity WHERE state <> 'idle' ORDER BY xact_start;اختبر فهمك
Why can one idle transaction cause table bloat?
أظهر الإجابة
Vacuum cannot remove versions the old snapshot may still see.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.