Optimizing SQL queries is always fun—except when it isn’t. If you’re a MySQL veteran and have read the title, you already know where this is heading 😉. In that case, allow me to regale the uninitiated reader. This is the story of an (apparently) smart optimization to a SQL query that backfired spectacularly—and how we finally fixed it. It started off with a customer noticing that a SQL query was running slowly in their environment.
With the development of Icinga DB we not only rebuilt the core of how Icinga stores and reads monitoring data. With a complete rebuild of the monitoring module we took the chance and refined most aspects of the user interface as well. One aspect that got attention is the display of downtimes, using their time based nature and putting the resulting data into context and visualizing it. Here are some of the details. Icinga DB Web Downtime List.