Skip to content

perf: bound archive filter inventory queries - #754

Merged
chubes4 merged 2 commits into
mainfrom
perf-735-filter-inventory
Aug 26, 2026
Merged

perf: bound archive filter inventory queries#754
chubes4 merged 2 commits into
mainfrom
perf-735-filter-inventory

Conversation

@chubes4

@chubes4 chubes4 commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • replace eligible per-taxonomy unbounded event-ID materialization with selective grouped assignment counts
  • reuse grouped rows by Calendar generation while rerunning query-mutation eligibility before every cache hit
  • preserve canonical WP_Query/wp_get_object_terms fallback for customized, portable, scoped, and failed query paths
  • add production-shaped hierarchy, cross-filter, temporal, cache, hook, SQL-failure, and portability coverage

Production Context

After #749/#753, the USA-root date aggregate improved from 2.509s to 0.643s, but /location/usa?past=1 remained 7.336s cold and 5.626s immediately repeated. The remaining archive-render path called FilterAbilities once per public taxonomy, materializing the complete matching ID set before tallying each taxonomy.

Why This Does Not Repeat #736

The reverted #736 query was additive and joined the broad canonical posts query, adding a 1.384s / 1,097,796-row grouped scan while old scans remained. This change replaces eligible scans and starts from the one-row-per-event date table. Taxonomy constraints use indexed EXISTS; counted assignments group directly with COUNT(DISTINCT ed.post_id).

Safety

  • hierarchical terms expand through the existing canonical term-taxonomy resolver
  • direct, child, deep, and multi-term assignments deduplicate exactly
  • active cross-filters exclude the currently counted taxonomy as before
  • query mutation detection executes before cache lookup, so warmed rows cannot bypass request constraints
  • term/query callbacks, short circuits, SQLite/non-MySQL, search, geo, scope tokens, and SQL errors use canonical fallback
  • only normalized aggregate rows are cached; request-sensitive term objects and exclusion output are rebuilt

Verification

  • PHP syntax: pass for all changed files
  • git diff --check: pass
  • changed-file PHPCS: pass
  • changed-file PHPStan level 7: pass
  • independent blocker review: no release-blocking findings
  • local WordPress PHPUnit unavailable because WP Codebox returned an unparseable recipe payload; hosted MySQL/multisite CI is authoritative

Closes #735

@homeboy-ci

homeboy-ci Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-events

Review audit

review audit — passed

Deep dive: homeboy review audit data-machine-events --changed-since d49f5ff

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-audit-homeboy-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-audit-homeboy-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine-events/actions/runs/32923365500

Review lint

review lint — passed

ℹ️ Auto-fix: homeboy refactor data-machine-events --path /home/runner/work/data-machine-events/data-machine-events --changed-since d49f5ff --from lint --write
ℹ️ Some issues may require manual fixes
ℹ️ Full options: homeboy self docs commands/lint
Deep dive: homeboy review lint data-machine-events --changed-since d49f5ff

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-lint-homeboy-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-lint-homeboy-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine-events/actions/runs/32923365500

Review test

review test — failed

  • 1 failed out of 877 total
  • 7 skipped

ℹ️ Ignored a malformed test-failures sidecar (JSON error); the primary run result is preserved. Re-run with --analyze after the extension emits a valid sidecar for failure classification.
ℹ️ To run specific tests: homeboy review test data-machine-events -- --filter=TestName
ℹ️ Auto-fix lint issues: homeboy refactor data-machine-events --from lint --write
ℹ️ Collect coverage: homeboy review test data-machine-events --coverage
ℹ️ Save test baseline: homeboy review test data-machine-events --baseline
ℹ️ Analyze failures: homeboy review test data-machine-events --analyze
ℹ️ Pass args to test runner: homeboy review test -- [args]
ℹ️ Full options: homeboy self docs commands/test
Deep dive: homeboy review test data-machine-events

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-test-homeboy-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-test-homeboy-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine-events/actions/runs/32922378791
Tooling versions
  • Homeboy CLI: homeboy 0.361.5+8623c8740fc6
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: 9c95310b
  • Action: Extra-Chill/homeboy-action@v2

@chubes4
chubes4 merged commit eb1a053 into main Aug 26, 2026
3 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.

perf: bound hierarchical location archive query bursts

1 participant