From 126070068abda34fda0b880a36cc604b4ac8be2a Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 23 Jan 2026 12:27:43 -0800 Subject: chore!: remove total_history from api index response (#3094) Remove the expensive and inaccurate `total_history` field from the API index endpoint. The query `select sum(total) from total_history_count_user` ran on every request but is no longer relevant. The underlying table remains for per-user cached counts used by `/sync/count`. ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --- crates/atuin-server-sqlite/src/lib.rs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'crates/atuin-server-sqlite/src/lib.rs') diff --git a/crates/atuin-server-sqlite/src/lib.rs b/crates/atuin-server-sqlite/src/lib.rs index 9cc1e8a7..83d05ea5 100644 --- a/crates/atuin-server-sqlite/src/lib.rs +++ b/crates/atuin-server-sqlite/src/lib.rs @@ -231,17 +231,6 @@ impl Database for Sqlite { Ok(()) } - #[instrument(skip_all)] - async fn total_history(&self) -> DbResult { - let res: (i64,) = sqlx::query_as("select count(1) from history") - .fetch_optional(&self.pool) - .await - .map_err(fix_error)? - .unwrap_or((0,)); - - Ok(res.0) - } - #[instrument(skip_all)] async fn count_history(&self, user: &User) -> DbResult { // The cache is new, and the user might not yet have a cache value. -- cgit v1.3.1