Speed up and isolate legacy logbook context_id query (#71201)
Speed up and isolate legacy logbook context_id query (#71201)


nkgilley/home-assistant,w1ll1am23/home-assistant,w1ll1am23/home-assistant,mezz64/home-assistant,toddeye/home-assistant,nkgilley/home-assistant,toddeye/home-assistant,mezz64/home-assistant