# SQL query taking too much time to run

**URL:** <https://meta.discourse.org/t/sql-query-taking-too-much-time-to-run/36583>\
**Category:** Product Support\
**Created:** [December 11, 2015, 5:52pm UTC](https://meta.discourse.org/t/sql-query-taking-too-much-time-to-run/36583 "2015-12-11T17:52:56Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sergiolopes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sergiolopes/32/122065_2.png) [@sergiolopes](https://meta.discourse.org/u/sergiolopes)\
**Post date:** [December 11, 2015, 5:52pm UTC](https://meta.discourse.org/t/sql-query-taking-too-much-time-to-run/36583/1 "2015-12-11T17:52:56Z")

</div>

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.

Is this normal? Any advice?

 ![](https://global.discourse-cdn.com/meta/original/3X/2/5/25a09810e3f14ad5bb65f1e7b5266bc663a4adcf.png)

---

_[View the full topic](https://meta.discourse.org/t/sql-query-taking-too-much-time-to-run/36583)._
