In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
CREATE INDEX event_idx_accoun_aggreg_proper_type_id ON "Common"."Event" ("AccountCode","AggregateType","PropertyId","Type","Id" desc);
CREATE INDEX event_idx_id ON "Common"."Event" ("Id" desc);
SELECT
e."Id",
e."AggregateId",
e."CreatedUtc",
e."OriginClientId",
e."OriginSubjectId",
e."PropertyId",
e."Type"
FROM
"Common"."Event" AS e
WHERE
e."AccountCode" = 'XXXX'
AND e."AggregateType" = 1
AND e."Type" IN (
'type-1', 'type-2', 'type-3', 'type-4'
)
AND e."PropertyId" = 'YYYY'
ORDER BY
e."Id" DESC LIMIT 100 OFFSET 0