Refer to issue number : https://wavelet.atlassian.net/browse/WH-41308
Customer reports that the report generation is too slow.
Try to generate the report in both customer and training server for comparison. As for example, the report generation in customer server is more than 5 minutes and in training server is less than 1 minutes.
Check the indexing and if there is any duplicate index. :
If everything was indexed and no duplicate index, run analyze verbose and vacuum full on the customer database. It is recommended to do this at night after no user is using the server.