1---2name: db-performance3description: Производительность БД и запросов 1С. Используй когда нужно диагностировать slow query, SQL/DBMS trace, индексы, блокировки, deadlock, TEMPDB/WAL, размеры таблиц или СКД на больших данных.4---56# DB Performance78## MCP routing910- Preferred path: use MCP `unica` tools `unica.view {}`, `unica.search`, `unica.view` on the object node, `unica.view` on the schema node, `unica.check`, `unica.docs`, and `unica.run`.11- Runtime идёт через `unica.run`: вызов без `op` отдаёт словарь операций и12контракт каждой — `argsSchema`, `execution`, `previewRequired`,13`ifRevRequiredOnApply`. Контракт вызова бери оттуда, а не из этого текста;14выбирай только операцию с `implemented: true` и не выдумывай аргументов15записи с `argsSchema: null`; превью исполнением не является. Не обходи16контракт прямым runner-ом.17- Use `unica.view` on the role node when performance behavior depends on rights filters, RLS, or tenant boundaries.18- Do not call internal analyzer, runtime, standards, or package adapters directly. They are hidden behind MCP `unica`.1920## References2122- Read `../../references/platform/db-performance.md` for DB-aware workflow, indexes, virtual tables, locks, and DBMS evidence.23- Read `../../references/platform/runtime-diagnostics.md` when performance evidence comes from ЖР/ТЖ, process ids, sessions, or runtime timeline.24- Read `../../references/platform/transactions-locks.md` once evidence points at contention; this skill keeps the evidence side, that document owns the lock and transaction rules.2526## Workflow27281. Name the slow scenario first: user action, API call, report, background job, exchange step, or posting.292. Extract exact query/DCS text with `unica.search` or `unica.view` on the schema node; inspect large candidate modules with `unica.view` on the module node (its `Method` branch lists the methods) before reading full bodies.303. Find callers with `unica.search` by the method name when the performance issue depends on execution path, query-in-loop risk, or impact of moving logic; a call graph is not on the v0.13 surface.314. Inspect `unica.view` on the object node for both the local object structure and related modules, roles, subscriptions, functional options, or predefined items that can change the performance path.325. Gather evidence: row counts, generated SQL, query plan, managed locks, lock order, lock/deadlock participants, long transaction boundaries, temp storage, TEMPDB or WAL pressure, and table/index names.336. Separate causes: inefficient platform query, missing or harmful index, broad virtual table read, query-in-loop, lock contention, DBMS maintenance, or data growth.347. Propose one measurable change at a time; check syntax with `unica.check` (test runs are outside the v0.13 surface), and require separate runtime plus timing/DBMS evidence before calling the change verified.3536## Stop rules3738- Do not recommend indexes without a concrete predicate, join, sort, grouping, and write-cost tradeoff.39- Do not remove rights filters, tenant filters, or `РАЗРЕШЕННЫЕ` for performance without a named security decision.40- Do not claim a DBMS root cause without DBMS evidence. State missing evidence or Unica MCP contract gap.4142## Output4344- Scenario and evidence summary.45- Root cause ranked by likelihood.46- Minimal query/metadata/code change.47- Verification command or measurement.48- Residual risk for data volume, locks, or DBMS-specific behavior.