# La sezione recensioni genera un errore 500 del server per un moderatore specifico

**URL:** <https://meta.discourse.org/t/review-section-results-in-500-server-error-for-a-specific-moderator/414526>\
**Category:** Bug\
**Tags:** moderation, fixed\
**Created:** [12 Ottobre 2026, 3:21pm UTC](https://meta.discourse.org/t/review-section-results-in-500-server-error-for-a-specific-moderator/414526 "2026-10-12T15:21:07Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [12 Ottobre 2026, 8:52pm UTC](https://meta.discourse.org/t/review-section-results-in-500-server-error-for-a-specific-moderator/414526/6 "2026-10-12T20:52:14Z")

</div>

ho trovato un modo per ottimizzare la query senza usare il trucco `OFFSET 0`

> <https://github.com/discourse/discourse/pull/44497>
>
> Previously, the review queue built every visible topic and every private message… a moderator can see as whole-table subqueries (\`topic\_id IN (...)\` and \`NOT IN (...)\`). On large sites, Postgres scanned millions of posts or rescanned the PM list once per reviewable. \`/review\` then timed out with a 500 for non-admin moderators (https://meta.discourse.org/t/414526).
> 
> This change correlates those checks to each reviewable's topic with \`EXISTS\` / \`NOT EXISTS\`, so Postgres does index lookups per reviewable, with the same visibility rules.
> 
> On a 1M topic / 8M post dataset, the count + page queries for a moderator drop from ~10–32s to ~0.5s, and the pending count from ~4.5s to ~50ms.

---

_[View the full topic](https://meta.discourse.org/t/review-section-results-in-500-server-error-for-a-specific-moderator/414526)._
