0xMiden / 0xMiden/node

Remove or fix `query_plan` module

Open
#2,017 4 comments 0 reactions 0 assignees View on GitHub
store
Dominant language
Rust
Stars
104
Forks
138
Avg merge
1d 13h
Merged PRs (30d)
56

Description

The query-plan check was meant to be a test-time guard against accidental full table scans.

Originally the flow was roughly:
- Store queries used the repo’s custom `Transaction` wrapper around `rusqlite::Transaction`.
- Queries prepared SQL through `Transaction::prepare_cached(sql)`.
- In `#[cfg(test)]`, `prepare_cached` called `self.check_query_plan(sql)`.
- check_query_plan ran: `EXPLAIN QUERY PLAN `. It rendered SQLite’s plan and failed the test if it found an unnecessary `SCAN`, while allowing indexed scans like `SCAN ... USING INDEX`.

After the migration to Diesel this is effectively orphaned. We should either find a way to perform the same checks with Diesel or remove this orphaned module entirely.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.