Unsafe search response DB operations
Sentry reported an IndexError
in search.response.event_datatables_response
here.
Looking into it, I've realized that this call to count()
performs a SQL SELECT COUNT(*)
, which can then be outdated by the time we iterate over a second query. This all seems to be part of optimizations made in !163 (merged). I would consider reverting that MR, or if avoiding list.append
is actually having a measurable performance benefit, using something like a pre-allocated 2D buffer array.