From 50c0e0d22484fc824ebc3729b53ea727df5f6876 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 28 Apr 2025 10:25:22 -0500 Subject: [PATCH] Set bbox parameters directly in the query. This seems to fix the performance gap. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1ba615f..227c3f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,9 +34,9 @@ fn main() -> Result<(), Box> { r#"create table {table} as select * from read_parquet("{root}") where bbox.xmin between {xmin} and {xmax} and bbox.ymin between {ymin} and {ymax};"# ); let query = format!( - r#"create table {table} as select * from read_parquet(?) where bbox.xmin between ? and ? and bbox.ymin between ? and ?;"# + r#"create table {table} as select * from read_parquet(?) where bbox.xmin between {xmin} and {xmax} and bbox.ymin between {ymin} and {ymax};"# ); - conn.execute(&query, params![root, xmin, xmax, ymin, ymax,])?; + conn.execute(&query, params![root,])?; } Ok(()) }