Skip to content

Commit

Permalink
chore(db): create index on created_at for user_completions (TabbyML#1789
Browse files Browse the repository at this point in the history
)

* chore(db): Create index on created_at for user_completions

* Apply suggestion

* Reorder index fields

* Apply suggestion

* Move migration

* Fix conflicts
  • Loading branch information
boxbeam authored Apr 9, 2024
1 parent d6020e8 commit d6130c2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX idx_user_completion_user_id_created_at_language;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX user_completions_user_id_language_idx;
CREATE INDEX idx_user_completion_user_id_created_at_language ON user_completions(user_id, created_at, language);
Binary file modified ee/tabby-db/schema.sqlite
Binary file not shown.
1 change: 0 additions & 1 deletion ee/tabby-db/src/user_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ impl DbConn {
Ok(())
}

// FIXME(boxbeam): index `created_at` in user_completions table.
pub async fn compute_daily_stats_in_past_year(
&self,
users: Vec<i64>,
Expand Down

0 comments on commit d6130c2

Please sign in to comment.