On Dec 3, 2021, at 8:11 AM, liam saffioti <liam(dot)saffiotti(at)gmail(dot)com> wrote:
> Indexes:
> "T_CMN_SLAHISTORY_HistoryId_idx" UNIQUE, btree ("HistoryId")
> "Index-20180207-152712" btree ("RuleName", "DefinitionId")
> "Index-20180712-192739" btree ("DefinitionId", "IsOldRecordBatch")
> "Index-20180712-192836" btree ("InstanceId")
Your query was "...WHERE x."DefinitionId" = '302';", but you don't have an index on *just* "DefinitionId". Try creating one.