Skip to content

Commit 4389742

Browse files
committed
Bug 1931811 - Weather queries are slow due to lack of index on geonames_alternates(geoname_id)
This adds an index on `geonames_alternates(geoname_id)` plus some geonames and weather benchmarks that I used to verify the change. The bug has some benchmark numbers and discussion. The index speeds up weather queries by as much as ~98%, going from hundreds of ms in the worst case to ~10ms.
1 parent 91c55bf commit 4389742

File tree

6 files changed

+870
-18
lines changed

6 files changed

+870
-18
lines changed

components/suggest/benches/benchmark_all.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ use criterion::{
22
criterion_group, criterion_main, measurement::Measurement, BatchSize, BenchmarkGroup, Criterion,
33
};
44
use std::sync::Once;
5-
use suggest::benchmarks::{ingest, query, BenchmarkWithInput};
5+
use suggest::benchmarks::{geoname, ingest, query, BenchmarkWithInput};
6+
7+
pub fn geoname(c: &mut Criterion) {
8+
setup_viaduct();
9+
let group = c.benchmark_group("geoname");
10+
run_benchmarks(group, geoname::all_benchmarks())
11+
}
612

713
pub fn ingest(c: &mut Criterion) {
814
setup_viaduct();
@@ -44,5 +50,5 @@ fn setup_viaduct() {
4450
INIT.call_once(viaduct_reqwest::use_reqwest_backend);
4551
}
4652

47-
criterion_group!(benches, ingest, query);
53+
criterion_group!(benches, geoname, ingest, query);
4854
criterion_main!(benches);

0 commit comments

Comments
 (0)