Skip to content

perf(storage): SQL history index + prune without nested OFFSET (#428) - #442

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/428-sql-history-index-prune
Jul 27, 2026
Merged

perf(storage): SQL history index + prune without nested OFFSET (#428)#442
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/428-sql-history-index-prune

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • Composite index (connection_id, database_name, recorded_at DESC, id DESC) matching list/prune predicates.
  • Prune: COUNT → select oldest overflow ids → DELETE … WHERE id IN (…).
  • Local DB schema version 8 migration drops/recreates the lookup index.

Closes #428

Test plan

  • flutter test test/core/storage/sql_query_history_test.dart
  • Existing install upgrades cleanly; history still caps per DB bucket

Index (connection_id, database_name, recorded_at, id); prune via count +
oldest-id DELETE instead of nested OFFSET subquery. Schema v8 migration.

Closes #428
@github-actions github-actions Bot added performance Theme parser epic label: performance storage Theme parser epic label: storage core Core library logic and services labels Jul 27, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 83436e0 into dev Jul 27, 2026
4 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/428-sql-history-index-prune branch July 27, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core library logic and services performance Theme parser epic label: performance storage Theme parser epic label: storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant