From 3fab58827017041168a769184469cff3722d6c38 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 23 Oct 2024 00:31:53 -0400 Subject: Make sure (most) queries avoid table scans. I've exempted inserts (they never scan in the first place), queries on `event_sequence` (at most one row), and the coalesce()s used for event replay (for now; these are obviously a performance risk area and need addressing). Method: ``` find .sqlx -name 'query-*.json' -exec jq -r '"explain query plan " + .query + ";"' {} + > explain.sql ``` Then go query by query through the resulting file. --- src/boot/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/boot') diff --git a/src/boot/app.rs b/src/boot/app.rs index 1d88608..e716b58 100644 --- a/src/boot/app.rs +++ b/src/boot/app.rs @@ -23,7 +23,7 @@ impl<'a> Boot<'a> { let resume_point = tx.sequence().current().await?; let logins = tx.logins().all(resume_point.into()).await?; - let channels = tx.channels().all(resume_point.into()).await?; + let channels = tx.channels().all(resume_point).await?; let messages = tx.messages().all(resume_point.into()).await?; tx.commit().await?; -- cgit v1.2.3