Skip to content

Every page render fires unanchored cross-schema queries (access, notifications, threads, mesh_nodes) — ~2 s each over 186 partition schemas #2640

Description

@rbuergi

Measured from Loki on memex-cloud (namespace memex-cloud, 05:32–06:02Z, 2026-08-29, probe script from the mesh):

716 × [CrossSchema] SLOW … across 186 schema(s)
  mesh_nodes     454 ×  avg 1710 ms  max 7827 ms
  notifications  117 ×  avg 1997 ms  max 4533 ms
  access         113 ×  avg 2055 ms  max 5643 ms
  threads         32 ×  avg 1929 ms  max 3825 ms

PostgreSqlCrossSchemaQueryProvider warns each time: "An unanchored query UNIONs every partition; add a path:/namespace: first segment to pin it to one schema." These fire on ordinary page loads (browser timings: server 40–250 ms, DOM < 1 s, first painted layout area 1.5–2.2 s) — the access and notifications ones look like the permission evaluation and the notification bell, threads the chat thread list, and a large share of mesh_nodes are 0/0-row lookups (misses).

The per-page floor is therefore ~2 s and grows with the partition count. Candidates: anchor the permission/notification/thread queries to the viewer's partition ({user}/…) + the group-grant partitions, cache the access fold per circuit, and stop the Admin/Menu/{X} route misses ([ROUTE] NotFound: No node found at 'Admin/Menu/AI' ×7/30 min per menu key) which each pay a routed lookup.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETgRRMRVzYMg1WU4pMywed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions