PagerDuty's introduction of Multi-User Alerting in 2014 allowed incidents to notify and assign multiple users, necessitating changes in their data model and SQL queries to maintain performance. The migration involved shifting from a 1:1 to a 1:many relationship in their Rails app, impacting how incidents with different states—triggered, acknowledged, or resolved—were queried. While resolved incidents were unaffected by the change, triggered and acknowledged incidents required sophisticated SQL techniques to ensure efficiency. For triggered incidents, a LEFT JOIN was used to identify those with no acknowledgements, whereas acknowledged incidents initially faced performance issues with the DISTINCT keyword, leading to the adoption of a more efficient LEFT JOIN technique. This method, inspired by advanced SQL querying strategies, allowed for handling duplicates without performance degradation and preserved the correct behavior of aggregate functions like COUNT in Rails. The process highlighted the importance of profiling SQL queries and understanding query optimizers, showcasing the innovative solutions needed to enhance database performance for complex alerting systems.