From 461aad2c52d7d6c2c6ca1df4cb30b77c52027d46 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 10 Mar 2023 14:05:45 -1000 Subject: [PATCH] remove index that will never be used --- homeassistant/components/recorder/db_schema.py | 5 ----- homeassistant/components/recorder/migration.py | 1 - 2 files changed, 6 deletions(-) diff --git a/homeassistant/components/recorder/db_schema.py b/homeassistant/components/recorder/db_schema.py index 3ac1b55bef2..c3bc6551ed6 100644 --- a/homeassistant/components/recorder/db_schema.py +++ b/homeassistant/components/recorder/db_schema.py @@ -179,11 +179,6 @@ class Events(Base): """Event history data.""" __table_args__ = ( - # Used for fetching events at a specific time - # see logbook - Index( - "ix_events_event_type_id_time_fired_ts", "event_type_id", "time_fired_ts" - ), Index( EVENTS_CONTEXT_ID_BIN_INDEX, "context_id_bin", diff --git a/homeassistant/components/recorder/migration.py b/homeassistant/components/recorder/migration.py index d5bf8c3db5f..b44066cf5ed 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -983,7 +983,6 @@ def _apply_update( # noqa: C901 elif new_version == 37: _add_columns(session_maker, "events", [f"event_type_id {big_int}"]) _create_index(session_maker, "events", "ix_events_event_type_id") - _create_index(session_maker, "events", "ix_events_event_type_id_time_fired_ts") else: raise ValueError(f"No schema migration defined for version {new_version}")