perf(users): project only administrative summary fields

This commit is contained in:
cesnimda
2026-11-18 19:10:47 +01:00
parent 213793c11c
commit 2c5d04513e
27 changed files with 355 additions and 2 deletions
+30
View File
@@ -0,0 +1,30 @@
# Admin user-summary SQL projection
18 November 2026. Baseline `63db9c8a`, isolated `codex/perf-mariadb-qualification`. Relevant controller/test source matches A3 `213793c1`; no frontend, route, DTO, schema, role/mutation, package or configuration change.
## Result
The production user list previously loaded all 49 Identity columns, including CV text/structure, avatar data, password hash and encrypted TOTP state, before mapping ten fields into the unchanged summary DTO. EF now selects only those ten required fields. The two-query role batching, global admin count, current-user flag, full list, existing email ordering, null fields and linked-Google timestamp are preserved. Reads remain untracked; create/reset/role/delete and legacy manually-constructed-controller behavior are unchanged.
| Measurement | Before | After |
| --- | ---: | ---: |
| Actual SQLite user SELECT columns | 49 | 10 |
| Actual MariaDB user SELECT columns | Not separately run | 10 |
| Reader commands | 2 | 2 |
| Synthetic users per fixture | 75 | 75 |
Each fixture user has 147,456 ASCII bytes across CV text/structure/avatar fields. Those three fields total **11,059,200 bytes** across the fixture and are now absent from the database result. This is eliminated known fixture content, not a measured wire payload, heap allocation, latency or production workload improvement. The HTTP DTO payload is unchanged. No credentials were returned by the old DTO; no disclosure exploit is claimed. Full Users fetch and role-row growth remain open under PERF11; this change does not constitute pagination.
## Verification
- Original ordinary run: six passed, one failed because the new test compared SQLite BINARY order with culture-sensitive .NET order. The verifier was corrected to ordinal order; no application sorting changed.
- Corrected unchanged-source baseline: six passed, one expected failure, actual SELECT49 rather than10. Native SQL and TRX retain the baseline field list.
- Final affected ordinary subset: **12/12 passed, zero skips**, including seven UsersController tests and existing ownership/current-user checks. The summary case verifies all ten fields, null values, order, 75 rows, arbitrary Member role, current-user/last-admin safety, two queries, no identity role N+1 calls and no tracked partial user entities.
- Actual pinned local **MariaDB12.2.2**: **2/2 passed, zero skips**, separate 75-user one-admin/two-admin fixtures. Actual startup schema, independent generated databases, real EF/Pomelo SELECT10/two commands, returned DTO values, global last-admin state, nulls, ordering and no tracking verified. This targeted run does not extend the earlier98-case result to this new controller source as a full-project run.
- Compilation succeeded. Existing xUnit2012 warning in the earlier checklist native test remains; no warning suppression. No frontend changes require a new frontend build/browser run for this projection; actual HTTP auth and final UI/security acceptance remain separate.
The standard disposable lane used a fresh generated project, loopback port, pinned cached image, tmpfs/no persistent mounts,1CPU/768MiB and existing guarded schema lifecycle. All generated schemas were gone and only the owned test service was removed; user app containers/volumes were not targeted. No production/model/provider/restore execution. Exact source/native result/target/cleanup bindings: [receipts](user-list-projection/evidence/SOURCE_RECEIPTS.json).
Rollback removes only the Select; no data or schema rollback. Plan and preservation scope: [implementation plan](USER_LIST_PROJECTION_PLAN.md). Formal Phase10, Product Review, security, release, human/device and European rollout gates remain open.
Final AST-only graph refresh passed:19,993nodes/49,618edges, including the new native projection test. Existing optional PDF/SQL/symbol-free input warnings retained; no model labeling.