0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 16:57:36 +08:00
discourse/plugins/poll/app/serializers
Bianca Nenciu 9b0300a647
PERF: Preload voters_count and has_voted (#28808)
These fields are often used when serializing topics which may contain
multiple polls. On average, serializing a poll took 2+N queries where N
is the number of options. This change reduces the number of queries to
3, one for each field (Poll#voters_count, PollOption#voters_count and
Poll#has_voted?).
2024-09-10 18:41:08 +03:00
..
poll_option_serializer.rb PERF: Preload voters_count and has_voted (#28808) 2024-09-10 18:41:08 +03:00
poll_serializer.rb PERF: Preload voters_count and has_voted (#28808) 2024-09-10 18:41:08 +03:00