diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 01c1255437b5..ce6f83e5b3ae 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,10 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0. Added ----- +- automatic creation of index on the ``sender_id`` column when using an SQL + tracker store. If you have an existing data and you are running into performance + issues, please make sure to add an index manually using + ``CREATE INDEX event_idx_sender_id ON events (sender_id);``. Changed ------- diff --git a/rasa/core/tracker_store.py b/rasa/core/tracker_store.py index 71d41673354f..101a62164ce4 100644 --- a/rasa/core/tracker_store.py +++ b/rasa/core/tracker_store.py @@ -274,7 +274,7 @@ class SQLEvent(Base): __tablename__ = "events" id = Column(Integer, primary_key=True) - sender_id = Column(String, nullable=False) + sender_id = Column(String, nullable=False, index=True) type_name = Column(String, nullable=False) timestamp = Column(Float) intent_name = Column(String)