Set bbox parameters directly in the query. This seems to fix the performance gap.
This commit is contained in:
parent
4b3e57be44
commit
50c0e0d224
1 changed files with 2 additions and 2 deletions
|
@ -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};"#
|
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!(
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue