Skip to content

resolveLocalizationContext reads the same sys_setting namespace three times per request #10826

Description

@os-zhuang

Split out of #10757 (direction 5) by PM ruling on PR #10824, at low priority — see the calibration below.

resolveLocalizationContext issues three identicalselect * from sys_setting where namespace = ? per request (queries 16–18 of 24, measured on a live rig in PR #10824). The function already batches its own direct fallback into one $in, but the settings-service path it prefers calls SettingsService.get() three times, and each call runs loadRows(namespace, …) over the whole namespace.

Three reads of one question, inside one request. Replace them with one namespace read the three keys are picked out of.

Calibration — this is smaller than it looks

cloud#1539 measured these three reads running in parallel: 3 queries but 1 leg. Since that same work established that legs, not queries, are the latency multiplier, the win here is ~2 queries and ≈0 legs.

So this is not a latency fix, and should not be scheduled as one. It is worth doing because:

Constraints

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions