perf(form4): jit=off на v_form4_sheet_jsonb — компиляция JIT дороже выполнения

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
Andrey Epifancev 2026-10-29 12:11:25 +04:00
parent 95661c0ae5
commit 05fbfd1e1d
2 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ CREATE OR REPLACE FUNCTION v3.v_form4_sheet_jsonb(p_form_id integer, p_sheet cha
RETURNS TABLE(row_type character varying, depth integer, sort_order bigint, data jsonb)
LANGUAGE sql
STABLE
SET jit TO 'off' -- оценка плана выше порога JIT, компиляция дороже выполнения (AURORA-1846)
AS $function$
-- ═══ 1. Базовые INPUT-строки с расширенной иерархией ═══════════════════════
WITH inp_raw AS (

View File

@ -342,3 +342,14 @@ def test_cell_patch_returns_updated_ancestor_sums(f4, client):
_, groups, items, _ = check_sums(f4)
assert Decimal(str(groups[prog]["plan"]["q1"])) == 25
assert Decimal(str(items[prj]["plan"]["q1"])) == 25
def test_jit_off_on_sheet_jsonb(f4):
"""AURORA-1846: v_form4_sheet_jsonb выполняется с jit=off (оценка плана выше порога JIT)."""
rows = f4.sql(
"""SELECT p.proname, COALESCE(p.proconfig, '{}') FROM pg_proc p
JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE n.nspname = 'v3' AND p.proname = 'v_form4_sheet_jsonb'"""
)
assert len(rows) == 1, rows
assert "jit=off" in rows[0][1], f"нет SET jit = off: {rows[0][1]}"