zulip/analytics/lib
Mahhheshh 1198785c62 analytics: Improve do_increment_logging_stat performance.
The previous implementation using Django's `get_or_create` for
`do_increment_logging_stat` involved two separate database queries,
potentially leading to race conditions.

Use an `ON CONFLICT ... DO UPDATE` (aka "upsert") query, which
eliminates race conditions and improves performance.  This is mildly
complicated due to the different unique indexes across the various
tables, and the need for bug-for-bug compatibility with the previous
implementation.

Fixes #28947.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-05-06 16:34:01 -07:00
..
__init__.py
counts.py analytics: Improve do_increment_logging_stat performance. 2024-05-06 16:34:01 -07:00
fixtures.py requirements: Upgrade Python requirements. 2024-01-29 10:41:54 -08:00
time_utils.py python: Elide unnecessary list wrappers. 2023-09-13 12:41:23 -07:00