Skip to content

perf(captcha): simplify count() query for user ids

Jelle van der Waa requested to merge jelle/aurweb:micro-optimisations into master

Using .count() isn't great as it runs a count query on a subquery which selects all fields in the Users table. This rewrites it into a simple SELECT count(ID) from USers query.


EXPLAIN says both queries are simple but I am not 💯 sure.

Merge request reports