Foundationপ্রথম নীতি থেকে
LEVEL 8 · Database Systems

HOT Update

হট আপডেট

Heap-Only Tuple update — indexed column না বদলালে একই page-এর ভেতরে নতুন version, index entry ছাড়াই।

also: heap-only-tuple, hot-chain

শর্ত দুটো: (১) কোনো indexed column-এ change নেই, (২) একই page-এ জায়গা আছে — তখনই chain:

v1 (old) --t_ctid--> v2 (HEAP_HOT_UPDATED) --t_ctid--> v3
index: শুধু v1-এ একটাই entry
  • Index write বাঁচে — update-heavy table-এ HOT ratio-ই throughput
  • Fillfactor: page-এ ইচ্ছাকৃত ফাঁকা রেখে HOT chance বাড়ানো — ALTER TABLE ... SET (fillfactor = 80)
  • ভাঙে কখন? index-ওয়ালা column update বা page full — pg_stat_user_tables.n_tup_hot_upd মাপুন
SELECT n_tup_upd, n_tup_hot_upd,
       round(100.0*n_tup_hot_upd/NULLIF(n_tup_upd,0),1) AS hot_pct
FROM pg_stat_user_tables WHERE relname = 'churn';

Index design = HOT probability design — যে column index করবেন সেটাই সিদ্ধান্ত।