pls how to create optimize index for this query
SELECT aggregatedRes.qty, aggregatedRes.amt, aggregatedRes.dat,
aggregatedRes.sit, aggregatedRes.off, aggregatedRes.tk, aggregatedRes.datInt, aggregatedRes.crd, aggregatedRes.startDate, aggregatedRes.endDate
FROM ( SELECT ARRAY_AGG(qty)[0] AS qty, ARRAY_AGG(amt)[0] AS amt,
dat, sit, off, tk, datInt, crd, 1672531200000 AS startDate,1689033600000 AS endDate
FROM ( SELECT ROUND ( SUM(content.qty), 8) as qty, content.dat, content.sit,
content.off, content.tk, content.datInt, content.crd
FROM rxpReport
WHERE type = 'aD' AND content.a = 'TDCL' AND content.sD BETWEEN 1672531200000 AND 1689033600000
GROUP BY content.dat, content.sit, content.off, content.tk, content.datInt, content.crd
UNION
SELECT ROUND ( SUM(content.amt), 8) as amt, content.dat, content.sit,
content.off, content.tk, content.datInt, content.crd
FROM rxpReport WHERE type = 'aD' AND content.a = 'TDCL' AND content.sD BETWEEN 1672531200000 AND 1689033600000
GROUP BY content.dat, content.sit, content.off, content.tk, content.datInt, content.crd) AS res
GROUP BY res.dat, res.sit, res.off, res.tk, res.datInt, res.crd) as aggregatedRes
WHERE aggregatedRes.qty IS NOT NULL OR aggregatedRes.amt IS NOT NULL