Set bbox parameters directly in the query. This seems to fix the performance gap.

This commit is contained in:
Nolan Darilek 2025-04-28 10:25:22 -05:00
parent 4b3e57be44
commit 50c0e0d224

View file

@ -34,9 +34,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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(())
}