Enhanced fast path SELECT execution that supports WHERE clauses
(
conn: &Connection,
query: &str,
schema_cache: &SchemaCache,
)
| 576 | |
| 577 | /// Enhanced fast path SELECT execution that supports WHERE clauses |
| 578 | pub fn query_fast_path_enhanced( |
| 579 | conn: &Connection, |
| 580 | query: &str, |
| 581 | schema_cache: &SchemaCache, |
| 582 | ) -> Result<Option<DbResponse>, rusqlite::Error> { |
| 583 | // Try enhanced fast path detection |
| 584 | if let Some(fast_query) = can_use_fast_path_enhanced(query) { |
| 585 | // Only handle SELECT queries |
| 586 | if !matches!(fast_query.operation, FastPathOperation::Select) { |
| 587 | return Ok(None); |
| 588 | } |
| 589 | |
| 590 | // Check if table has decimal columns |
| 591 | match table_has_decimal_columns(conn, &fast_query.table_name, schema_cache) { |
| 592 | Ok(false) => { |
| 593 | return execute_fast_select(conn, query, &fast_query.table_name, schema_cache); |
| 594 | } |
| 595 | _ => { |
| 596 | // Has decimal columns or error checking, fall back to normal path |
| 597 | return Ok(None); |
| 598 | } |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | // Fall back to legacy fast path |
| 603 | query_fast_path(conn, query, schema_cache) |
| 604 | } |
| 605 | |
| 606 | /// Execute a fast SELECT query with parameters |
| 607 | fn execute_fast_select_with_params( |
nothing calls this directly
no test coverage detected