Skip to content

Speed up dupes README query#176

Merged
mxr merged 1 commit intomainfrom
speed-up-dupes-query
Mar 28, 2026
Merged

Speed up dupes README query#176
mxr merged 1 commit intomainfrom
speed-up-dupes-query

Conversation

@mxr
Copy link
Copy Markdown
Owner

@mxr mxr commented Mar 28, 2026

Summary

Speed up the README dupes query by checking payee usage directly from the base transaction tables instead of joining through the flattened transaction views.

Why

The old query forced SQLite to materialize flat_transactions and scheduled_flat_transactions, including category joins, just to answer whether a payee had ever been referenced. On the local database this changed the runtime from about 2.8s to about 0.01s.

Impact

The documented query stays functionally the same, but it is much cheaper to run on larger exports.

@mxr mxr enabled auto-merge (squash) March 28, 2026 16:43
@mxr mxr merged commit e33f368 into main Mar 28, 2026
9 checks passed
@mxr mxr deleted the speed-up-dupes-query branch March 28, 2026 16:44
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