Skip to content

perf(core): add taxonomyStrategy:"seek" for selective taxonomy-filtered listings (#1834) - #1843

Closed
MA2153 wants to merge 7 commits into
emdash-cms:mainfrom
MA2153:fix/1834-taxonomy-filter-seek-strategy
Closed

MA2153 wants to merge 7 commits into
emdash-cms:mainfrom
MA2153:fix/1834-taxonomy-filter-seek-strategy

Conversation

@MA2153

@MA2153 MA2153 commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

On SQLite/D1, a taxonomy-filtered collection listing (where: { category }, ordered + paginated) walks the entire collection table in ORDER BY order, applying the taxonomy filter as a correlated EXISTS per row. When the term is selective (few matches), the LIMIT never fills early, so the scan runs to the end of the table — on a ~26k-row collection this read ~75,000 D1 rows for a page returning one row. On D1, rows-read is the billed/throttled unit, so a routine category page reads the whole collection.

This adds an opt-in taxonomyStrategy: "seek" option to getEmDashCollection. When set, the query drives from content_taxonomies — seeking the term via a materialized _matched CTE (CROSS JOIN pins the join order) and joining the collection by primary key, then sorting the small candidate set. This reads only the matching entries.

The seek is forced onto the composite pivot index with an explicit INDEXED BY idx_content_taxonomies_term_lookup and a plain ct.collection = ? equality, so it seeks on both leading columns (taxonomy_id=? AND collection=?). Without a hint, a stats-blind D1 planner drives from the pivot PK's (collection, …) autoindex instead — a whole-collection scan of the join table. Seeking on both columns also matters when a term is shared across collections: a single-column (taxonomy_id=?) seek with a residual collection filter reads the term's rows in every collection, whereas the two-column seek reads only the queried collection's slice. Measured against a real D1 dataset, a shared selective term dropped from 704 rows read to 2 with the two-column seek.

The default ("scan") is unchanged and remains best for non-selective terms (a broad category holding most of the collection), where the ordered index walk fills the page quickly. Selectivity is a per-term property the framework can't know without a query, so the caller opts in per route. SQLite/D1 only — Postgres has statistics and plans this well on its own.

Also adds composite index content_taxonomies(taxonomy_id, collection, entry_id) (migration 051), which the seek plan relies on and which supersedes the single-column idx_content_taxonomies_term (its leftmost prefix covers the same reverse lookup).

Measured on the reporter's repro (26,224 rows, term matching 1 entry): scan ≈ 75,454 rows read / ~295 ms → seek ≈ 10 rows read / ~1 ms.

Closes #1834

Type of change

  • Performance improvement
  • Bug fix

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable) — n/a, no admin UI strings; this is a server-side query API change
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion — n/a, this is an additive, backwards-compatible option on an existing API (default behavior unchanged), fixing a reported performance bug

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.8 (Claude Code)

Screenshots / test output

New tests (TDD):

  • tests/unit/database/migrations/051_content_taxonomies_term_lookup.test.ts — composite index created, single-column index dropped.
  • tests/integration/loader-taxonomy-filter-plan.test.ts — EXPLAIN QUERY PLAN on stats-blind SQLite: "seek" drives from idx_content_taxonomies_term_lookup on both leading columns (taxonomy_id=? AND collection=?) (not the collection's published index); default (no hint) keeps the EXISTS scan unchanged.
  • tests/unit/loader-taxonomy-filter.test.ts — OR-within-one-taxonomy dedupe and a multi-collection case (a term shared by two collections stays scoped to the queried one, matching the scan path).

Existing two-dialect taxonomy-filter correctness tests (single / AND-across / OR-within / empty / localized) stay green. Affected suite: 42 passing; broader core sweep: 3048 passing.

🤖 Generated with Claude Code

…d listings (emdash-cms#1834)

On SQLite/D1, a taxonomy-filtered listing ordered + paginated walks the whole
collection in ORDER BY order applying the taxonomy filter as a correlated
EXISTS per row. For a selective term (few matches) the LIMIT never fills early,
so it scans the entire table — ~75k D1 rows read for a page returning one row.

Adds an opt-in `taxonomyStrategy: "seek"` filter option that drives the query
from content_taxonomies (materialized _matched CTE + CROSS JOIN, seeking by
taxonomy_id and joining the collection by primary key). Default "scan" is
unchanged and remains best for non-selective terms. SQLite-only; Postgres has
statistics and is untouched.

Also adds composite index content_taxonomies(taxonomy_id, collection, entry_id)
(migration 051), which the seek plan relies on and which supersedes the
single-column idx_content_taxonomies_term.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@changeset-bot

changeset-bot Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 67c6df4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@MA2153 MA2153 changed the title fix(core): add taxonomyStrategy:"seek" for selective taxonomy-filtered listings (#1834) perf(core): add taxonomyStrategy:"seek" for selective taxonomy-filtered listings (#1834) Jul 6, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1843

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1843

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@1843

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1843

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1843

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@1843

emdash

npm i https://pkg.pr.new/emdash@1843

create-emdash

npm i https://pkg.pr.new/create-emdash@1843

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1843

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@1843

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@1843

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@1843

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@1843

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@1843

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1843

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1843

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1843

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1843

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1843

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1843

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@1843

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1843

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1843

commit: 67c6df4

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Jul 6, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR addresses the right problem with a backwards-compatible approach: an opt-in taxonomyStrategy: "seek" hint that drives selective taxonomy-filtered listings from the pivot index on SQLite/D1, leaving the default EXISTS scan unchanged. The migration adds the needed composite index, drops the now-redundant single-column one, and is registered correctly. I checked the loader/query type plumbing, SQL safety (identifiers and values are parameterized), locale/byline/field/cursor handling, migration registration/DDL, index naming, and the new tests.

The headline issue is a correctness bug in the seek rewrite: the per-taxonomy candidate CTE selects ct.entry_id without DISTINCT. When the filter contains a single taxonomy with multiple slugs (e.g., { category: ['news', 'sports'] }) and an entry is tagged with more than one of those slugs, that entry_id appears in the CTE multiple times. The outer CROSS JOIN then emits the same content row multiple times. INTERSECT only deduplicates when at least two taxonomies are filtered, so OR-within-one-taxonomy cases are affected. The existing two-dialect correctness tests only run the default EXISTS path, and the new SQLite-only plan test uses a single slug, so this case is uncovered.

Fix by adding DISTINCT to the per-taxonomy selects and add a seek-path correctness test that ORs multiple slugs within one taxonomy (and ideally combines it with another taxonomy).

Comment thread packages/core/src/loader.ts Outdated
Comment on lines +1061 to +1067
(f) => sql`SELECT ct.entry_id AS _matched_id
FROM taxonomies t
INNER JOIN content_taxonomies ct ON ct.taxonomy_id = t.translation_group
WHERE +ct.collection = ${type}
AND t.name = ${f.name}
AND t.slug IN (${sql.join(f.slugs.map((s) => sql`${s}`))})
${locale ? sql`AND t.locale = ${locale}` : sql``}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[needs fixing] The seek-path _matched CTE selects entry IDs per taxonomy without DISTINCT. For a single taxonomy filter that ORs multiple slugs (e.g., { category: ['news', 'sports'] }), an entry tagged with both slugs appears in the CTE twice. The outer CROSS JOIN then emits duplicate rows for the same entry. The existing EXISTS path is a semi-join and never duplicates. INTERSECT only deduplicates when at least two taxonomies are filtered, so this case is broken.

Also extend the taxonomy correctness tests to exercise taxonomyStrategy: "seek" with OR-within-a-taxonomy to prevent regression.

Suggested change
(f) => sql`SELECT ct.entry_id AS _matched_id
FROM taxonomies t
INNER JOIN content_taxonomies ct ON ct.taxonomy_id = t.translation_group
WHERE +ct.collection = ${type}
AND t.name = ${f.name}
AND t.slug IN (${sql.join(f.slugs.map((s) => sql`${s}`))})
${locale ? sql`AND t.locale = ${locale}` : sql``}`,
(f) => sql`SELECT DISTINCT ct.entry_id AS _matched_id
FROM taxonomies t
INNER JOIN content_taxonomies ct ON ct.taxonomy_id = t.translation_group
WHERE +ct.collection = ${type}
AND t.name = ${f.name}
AND t.slug IN (${sql.join(f.slugs.map((s) => sql`${s}`))})
${locale ? sql`AND t.locale = ${locale}` : sql``}`,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Added DISTINCT to the per-taxonomy _matched select — the single-filter OR-within case had no INTERSECT to dedupe, so an entry tagged with both slugs fanned out through the CROSS JOIN. Corrected the comment too (it wrongly credited INTERSECT, which only dedupes across ≥2 filters).

Added two seek-path correctness tests to loader-taxonomy-filter.test.ts: OR-within-one-taxonomy, and OR-within combined with a second taxonomy, both cross-checked against the default scan path. Confirmed via TDD that both fail without the DISTINCT (duplicate row) and pass with it.

@MA2153
MA2153 marked this pull request as draft July 6, 2026 13:37
@github-actions github-actions Bot removed the review/needs-review No maintainer or bot review yet label Jul 6, 2026
…onomy

The seek-strategy `_matched` CTE selected pivot entry ids without
DISTINCT. For a single taxonomy filtered by multiple slugs
(`{ category: ['news', 'sports'] }`), an entry tagged with more than one
slug had a pivot row per slug and no INTERSECT to dedupe it, so the outer
CROSS JOIN emitted the content row multiple times. The default EXISTS
scan is a semi-join and never duplicated.

Add DISTINCT to the per-taxonomy select and add seek-path correctness
tests covering OR-within-one-taxonomy (alone and combined with a second
taxonomy), cross-checked against the scan path.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@MA2153
MA2153 marked this pull request as ready for review July 6, 2026 13:45
@github-actions github-actions Bot added the review/needs-rereview New commits since the last review label Jul 6, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The previous review's correctness bug is fixed: the per-taxonomy matched CTE now uses SELECT DISTINCT ct.entry_id, and the new tests cover the exact case that was broken — OR-ing multiple slugs within one taxonomy, both alone and combined with a second taxonomy. The integration plan test still verifies the seek path uses the composite pivot index, and the migration/index swap is registered correctly.

However, I have one remaining concern about the SQLite optimizer hack used to force that plan. The _matched CTE uses +ct.collection = ${type} to disqualify the pivot PK auto-index. Unary + on a TEXT expression forces numeric affinity in SQLite, so a predicate like +'post2' = 'post' is evaluated as 0 = 0 and would match other text collection names. The final CROSS JOIN with ec_${type} filters those mismatched rows out of the result (entry IDs from other collections can't exist in the requested table), but the CTE still reads/joins extra content_taxonomies rows from other collections, which partly undermines the D1 rows-read goal and creates a latent correctness hazard if anyone ever removes or weakens that final join. Add a multi-collection regression test and either confirm the plan/rows-read stay correct, or replace +ct.collection with a semantically neutral expression (e.g., CAST(ct.collection AS TEXT) = ${type}, or moving the collection equality into the join) and verify the planner still picks idx_content_taxonomies_term_lookup.

Overall this is the right additive fix for #1834 and is backwards-compatible. With the unary-plus concern verified/addressed, it's ready.

Comment thread packages/core/src/loader.ts Resolved
@MA2153
MA2153 marked this pull request as draft July 6, 2026 14:48
Add a seek-path test covering a term shared across two collections,
asserting the "post" listing stays scoped to posts and matches the scan
path. Verifies the reviewer's cross-collection concern on emdash-cms#1843 does not
manifest: the `+ct.collection` predicate keeps TEXT affinity (unary `+`
is a value/type no-op in SQLite), so `_matched` never admits other
collections' rows.

Also switch three seek-strategy assertions from `Array#sort()` to
`toSorted()` to clear the lint warnings introduced in 5840cf8.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions github-actions Bot added size/XL and removed review/needs-rereview New commits since the last review size/L labels Jul 6, 2026
@MA2153

MA2153 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

On the unary-plus concern — checked it directly and the premise doesn't hold. SQLite's unary + is a value/type no-op, not a numeric-affinity coercion (per the SQLite docs); it only strips index eligibility from its operand:

sqlite> SELECT (+'post2' = 'post'), typeof(+'post2');
0|text

So +ct.collection keeps TEXT affinity, +'post2' = 'post' is false, and the _matched CTE applies collection = ${type} as a residual TEXT predicate — it never admits rows from other collections. There's no cross-collection leak and nothing latent behind the final join.

The suggested rewrite (drop +) regresses the very plan it aims to preserve: on the real materialized-CTE + CROSS JOIN query the stats-blind planner abandons idx_content_taxonomies_term_lookup and falls back to the pivot PK autoindex on the non-selective collection column (sqlite_autoindex_content_taxonomies_1 (collection=?)), reintroducing the whole-table read #1834 fixes. The existing plan test fails the moment + is removed, which is exactly why it's there.

Added the multi-collection regression test you asked for (9dac25ec): a global term shared by a post and a page, filtering post via seek, asserting only the post returns and that it matches the scan path. Also cleared three toSorted() lint warnings from an earlier commit on this branch. Detail in the inline thread: #1843 (comment)

@MA2153
MA2153 marked this pull request as ready for review July 6, 2026 15:16
@github-actions github-actions Bot added review/needs-rereview New commits since the last review cla: signed labels Jul 6, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still the right additive, backwards-compatible fix for #1834. Since the prior review, the per-taxonomy DISTINCT is in place, the OR-within / AND-across correctness cases are covered, the migration/index swap (051) is wired up correctly, and the new multi-collection result test shows the observable payload stays scoped.

The one remaining concern from the prior review is not yet addressed, however: the seek rewrite still uses +ct.collection = ${type} to disable the pivot PK auto-index. Unary + on a TEXT column forces numeric affinity in SQLite, so a predicate like +ct.collection = 'post' evaluates as a numeric comparison and matches every text collection name (+'post2' → 0, 'post' → 0, 0 = 0). The final CROSS JOIN ec_${type} masks this by dropping entry IDs that don't exist in the requested table, so the current result set is correct, but:

  • the _matched CTE still reads/joins extra content_taxonomies rows from other collections, partially defeating the D1 rows-read optimization the PR is adding;
  • it creates a latent correctness hazard: anyone who later refactors the query and relaxes that final join could serve entries from the wrong collection.

Please replace +ct.collection with a semantically neutral, non-sargable expression (e.g. ct.collection || '' = ${type}), keep the existing plan test asserting idx_content_taxonomies_term_lookup, and consider extending the plan-level test to confirm the multi-collection rows-read behavior. Once that's verified this is ready to land.

Comment thread packages/core/src/loader.ts Resolved
The seek-path `_matched` CTE used `+ct.collection = ${type}` to disqualify
the pivot PK auto-index. The unary `+` forces only a single-column
`(taxonomy_id=?)` seek and applies `collection` as a residual filter, so a
term shared across collections reads that term's rows in *every*
collection, then discards the non-matching ones — a page returning one row
can read hundreds.

Replace it with an explicit `INDEXED BY idx_content_taxonomies_term_lookup`
plus a plain `ct.collection = ${type}` equality. This keeps the composite
index but seeks on both leading columns `(taxonomy_id=? AND collection=?)`,
reading only the queried collection's slice of the term. Measured against a
real D1 dataset, a shared selective term dropped from 704 rows read to 2.
Plain equality also removes the confusing unary `+`.

Tighten the plan test to assert the two-column seek so the residual-filter
form can't silently return.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@MA2153
MA2153 marked this pull request as draft July 6, 2026 16:46
@MA2153
MA2153 marked this pull request as ready for review July 6, 2026 16:46

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the right additive, backwards-compatible fix for #1834. The seek rewrite drives selective taxonomy listings from content_taxonomies on SQLite/D1, leaving the existing scan path as the default so non-selective terms keep their cheaper plan.

The one outstanding concern from the prior review has been addressed — the rewrite now uses a plain ct.collection = ${type} equality together with INDEXED BY idx_content_taxonomies_term_lookup. That avoids the numeric-affinity footgun of the previous unary-plus trick and, unlike a non-sargable expression, lets the composite index seek on both leading columns (taxonomy_id, collection). The new plan-level assertion confirms exactly that shape.

What I checked:

  • Migration 051 is correctly wired into runner.ts, creates the composite index before dropping the redundant single-column one, and its down path is symmetric.
  • The loader changes are SQLite-only, guard all required conditions (taxonomyStrategy === "seek", !isPostgres, and at least one taxonomy filter), and fall back cleanly to the existing EXISTS path.
  • Locale filtering, byline filters, field filters, cursor/offset pagination, and folded term/byline hydration are preserved on the seek path.
  • New tests cover the index swap, OR-within-one-taxonomy dedupe, AND-across-taxonomies semantics, multi-collection scoping, and the EXPLAIN shape. No other code references the dropped idx_content_taxonomies_term by name.

One non-blocking suggestion: the built-in getEntriesByTerm helper is the natural place to opt into this optimization, but it currently has no way to pass taxonomyStrategy. Adding and forwarding that option would make the most common term-archive use case benefit without callers dropping down to getEmDashCollection directly.


Findings

  • [suggestion] packages/core/src/taxonomies/index.ts:746-748

    The getEntriesByTerm helper is the canonical way to render a term archive page, but it cannot opt into the new "seek" strategy. Callers who want the optimization have to bypass this helper and write the getEmDashCollection invocation themselves.

    Consider extending TaxonomyQueryOptions (or the helper's options) with taxonomyStrategy?: "scan" | "seek" and forwarding it in queryOptions:

    const queryOptions: Record<string, unknown> = {
    	where: { [taxonomyName]: termSlug },
    	taxonomyStrategy: options.taxonomyStrategy,
    };

    This keeps the helper useful for the exact /tag/[slug] case the new option is designed for.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview New commits since the last review labels Jul 6, 2026
@MA2153
MA2153 marked this pull request as draft July 7, 2026 03:22
@MA2153

MA2153 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by a reworked implementation: instead of a manual strategy option, the loader now plans taxonomy-filtered listings automatically from cached per-term counts (single-term seek/scan + multi-term smallest-first nested-loop). Design write-up in Discussion #1851; a fresh PR follows. Closing this one.

@MA2153 MA2153 closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Taxonomy-filtered collection queries do a full table scan (75k+ D1 row reads) on selective terms

1 participant