mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 12:24:55 +00:00
restructure query so it avoids ORs It appears postgres is picking suboptimal indexes if too many ORs exist despite how trivial the condition is. This bypasses conditional in the query and evals them upfront. On meta for my user this made a 10x perf difference. This boils down to either having `OR u.admin` or not having `OR u.admin` in the query.