Implement lab 3 level 4 failover and idempotency

This commit is contained in:
2026-10-29 23:35:04 +03:00
parent 0ab3a341aa
commit a2cb1ad2ae
338 changed files with 37821 additions and 22 deletions
+20
View File
@@ -0,0 +1,20 @@
package main
import "testing"
func TestPlanBudgetIncludesFilteredRowsAndLoops(t *testing.T) {
plan := map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1),
"Plans": []any{map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(2),
"Rows Removed by Filter": float64(8000)}}}
if maxVisited(plan) != 16102 {
t.Fatal("deep scan hidden by LIMIT or ignored loop count")
}
}
func TestPlanBudgetDoesNotDoubleCountParentAndChild(t *testing.T) {
plan := map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1),
"Plans": []any{map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1)}}}
if maxVisited(plan) != 51 {
t.Fatal("same tuples double-counted through the plan hierarchy")
}
}