In a support thread regarding a slow SQL query on Discourse, sergiolopes reported that opening the home page as a logged-in user took over 500ms, even on an upgraded AWS RDS instance, despite the forum containing 1.6 million messages. codinghorror suggested checking for unusual category permissions or testing with an anonymous user. Upon further testing, sergiolopes confirmed the issue only affected logged-in users (admin or normal), while anonymous access remained fast at 30ms. The user was running version 1.4.3. sam recommended updating to the latest version, noting the query had been rewritten, and specifically advised switching to the beta branch 1.5.0-beta6. After updating to the beta, performance improved significantly, with logged-in user query times dropping to 60-100ms and anonymous times to 10ms sergiolopes.
We are migrating an old forum with 1.6 million messages to Discourse. When opening the home page as logged in user, there is a super query taking too long to execute (many seconds). We are still testing so there is only one user - me.
We are on AWS using RDS. On our default machine, it took more than 13s to return this query. I updated to a xlarge super machine for testing and still this query take more than 500ms.
More than 500ms isn’t outside the realms of normal. Do you have unusual permissions on the categories? Have you tested with an anonymous or new user rather than a staff user?