Files
knowledge-governance/internal/platform/postgres
姚章浩 c84f848849 perf(catalog): resolve filename filters once per query, not per row
The 000036 evaluator probes the rules table and runs two regexes for every
catalog file row; the first-level page of the 8k-file education source took
2.5-5s per query and the browser hung on 'reading first-level directory'.

- source_catalog_nodes gains a STORED generated ext column (000038)
- catalog_filter_context() resolves the connection's source-level allow/
  exclude sets once; hot queries match node.ext against arrays (000039)
- filename_is_filtered stays the exact fallback, used only when the
  connection has directory-scoped rules
- ListCatalogSources, ListCatalogNodes (current/subtree/total/items) and
  RouteCatalogFiles fan-out adopt the fast path

Education root page: 4770ms -> 12ms; all-source counts: 54ms.
2026-09-30 10:54:07 +08:00
..