The Stats "most seen aircraft" card now shows the current day, not all of history — and loads quickly. This card sits in the Composition group alongside "most seen types" and "most seen operators," which both count the current day. The most-seen-aircraft card was meant to do the same but, because of a units mistake in how it filtered by time, it was actually counting every sighting ever recorded. That made it both incorrect (showing all-time regulars instead of today's) and slow (it had to crunch the entire history rollup on every Stats load — the single slowest part of the page). It now correctly counts the current day, matching its sibling cards, and as a result returns almost instantly. The expanded "top 100" list behind the card had the same issue and is fixed the same way.
- Applied the same time-window correction to the watchlist-frequency card so it filters its 30-day window correctly rather than relying on the rollup happening to hold only recent data.
Behind the scenes
- The hourly rollup stores its timestamp (
hour_bucket) in seconds, truncated to the hour. The affected queries were dividing the window start by 3600 before comparing, which produced a threshold so small that every row matched — so the "where the time window" filter selected the whole table. Removing the stray division makes the comparison seconds-against-seconds, so the filter is selective and the database can use the time index instead of scanning everything. On the reference install this turns the most-seen-aircraft card from well over a second into a few milliseconds. - The card's contents will change for anyone who had been unknowingly seeing all-time figures: it now reflects the configured day window, consistent with the rest of the Composition group. This is the intended behavior.
Operational notes
- No schema changes, no config changes, no migration.
- Expected behavior after deploy: the most-seen-aircraft card and its expanded list show the current day and load quickly; the Stats page overall is noticeably faster.