Skip to content

chore(deps): adopt @query-doctor/core ^0.22.0 - #224

Merged
veksen merged 1 commit into
mainfrom
chore-adopt-core-0-22-0
Aug 6, 2026
Merged

chore(deps): adopt @query-doctor/core ^0.22.0#224
veksen merged 1 commit into
mainfrom
chore-adopt-core-0-22-0

Conversation

@veksen

@veksen veksen commented Aug 6, 2026

Copy link
Copy Markdown
Member

Goal

Deliver expression index recommendations to CI users. The engine change landed in Query-Doctor/Site#3881 and published as @query-doctor/core@0.22.0; nothing reaches a CI run until the analyzer resolves that version. This is the last step.

What

A query filtering on a function now gets an index recommendation. WHERE lower(email) = $1 previously produced no recommendation and only a warning saying a function on a column prevents index usage. It now produces CREATE INDEX ON users ((lower(email))), costed against the planner like any other recommendation. The same holds for btrim, md5, length, substring, ||, and coalesce.

coalesce(nickname, email) = $1 previously produced separate recommendations for nickname and email, neither of which can serve that predicate. It now produces one expression index.

Two fixes come with it. An index recommendation could be hidden: a plain composite reported that it covered an expression index on the same leading column, which it cannot serve. And an optimization could fail outright, because Postgres refuses to index an expression whose function is not IMMUTABLE and that refusal aborted the transaction.

How

A version bump and a lockfile refresh. No analyzer code changes.

The caret had to move rather than resolve on its own: ^0.21.0 does not admit 0.22.0.

Worth knowing for this repo specifically: core now states on PostgresTransaction that a failed exec rolls back on its own and later execs still run. src/sql/postgresjs.ts already satisfies that, since it wraps every statement in a savepoint — behaviour inherited from postgres.js and reimplemented by hand in 90c05fd during the move to pg. Core no longer takes savepoints of its own, so that adapter is now the only thing providing the guarantee here. An adapter added later has to do the same or use withStatementIsolation from core.

Tests

Full suite passes against 0.22.0: 43 files, 440 tests. Build clean.

The Site-side analyzer-compat check ran this repo's suite against the new core throughout #3881 and passes.

🤖 Generated with Claude Code

Brings in expression index recommendations for function-wrapped columns, so a
query filtering on lower(email) gets an index instead of only a warning.

Co-Authored-By: Claude <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query Doctor — 6 successful checks

 Cost regression — No query went up more than 5%
 Untested data access — No changed data-access file without a test
 New query — No new queries
 New query with index recommendation — No new query ships an index recommendation
 Schema drift — No schema changes
 High-value nudge — No index or rewrite past the threshold


More details via MCP → get_ci_run({ runId: "019fd4ac-101f-78d4-81b1-36ff402b5a80" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.

@veksen
veksen merged commit 78ab91d into main Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant