I have one which takes some around 35-40 ms on my local machine but take more than 500 ms on live machine.
Following is the query
SELECT pin
FROM activity
USE INDEX (activity_pin_report
) UNNEST activity
.pins
AS pin
WHERE pin
.pin_type
=“report” AND
pin
.place_id
=‘MMI000’ AND pin
.status
=1 ORDER BY pin
.user_name
=‘shashankkapsime’ DESC
and uses following indexing
CREATE INDEX activity_pin_report
ON activity
((distinct (array (pin
.place_id
) for pin
in pins
when (((pin
.pin_type
) = “report”) and ((pin
.status
) = 1)) end)))
What else need to be considered for this