What to build
The GetCountryQuery handler compares c.ISO3Code.ToLower().Equals(...), which translates to LOWER() on both sides of the predicate — the index on the char(3) PK is not used. Compare the ISO3 code directly against the PK column (WHERE iso3 = @p) and handle case-insensitivity client-side (PK is char(3); string.Equals(..., StringComparison.OrdinalIgnoreCase) after fetch).
Acceptance criteria
Blocked by
None (can start immediately).
What to build
The
GetCountryQueryhandler comparesc.ISO3Code.ToLower().Equals(...), which translates toLOWER()on both sides of the predicate — the index on thechar(3)PK is not used. Compare the ISO3 code directly against the PK column (WHERE iso3 = @p) and handle case-insensitivity client-side (PK ischar(3);string.Equals(..., StringComparison.OrdinalIgnoreCase)after fetch).Acceptance criteria
LOWER()on the indexed side (verifiable via query plan or logged SQL).Blocked by
None (can start immediately).