Skip to content

Commit

Permalink
add index for improving most_recent_event_only use case
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
  • Loading branch information
nhoening committed May 12, 2024
1 parent efbc3fb commit 966dba8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions timely_beliefs/beliefs/classes.py
Expand Up @@ -193,6 +193,11 @@ def __table_args__(cls):
"belief_horizon", # we use min() on this (most_recent_beliefs_only)
],
),
Index(
f"{cls.__tablename__}_search_session_singleevent_idx",
"event_start",
"sensor_id",
),
)

event_start = Column(DateTime(timezone=True), primary_key=True, index=True)
Expand Down

0 comments on commit 966dba8

Please sign in to comment.