# HG changeset patch # User Mads Kiilerich # Date 2016-03-14 16:17:46 # Node ID d36dc6617d877a563a8173ac947fe763690ae60a # Parent 0c29e737db23e1d975e856592b7817c60ce86fa1 pullrequests: add index - optimize some slow queries diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -2225,6 +2225,7 @@ class ChangesetStatus(Base, BaseModel): Index('cs_pull_request_id_idx', 'pull_request_id'), Index('cs_changeset_comment_id_idx', 'changeset_comment_id'), Index('cs_pull_request_id_user_id_version_idx', 'pull_request_id', 'user_id', 'version'), + Index('cs_repo_id_pull_request_id_idx', 'repo_id', 'pull_request_id'), UniqueConstraint('repo_id', 'revision', 'version'), _table_args_default_dict, )