]> git.xonotic.org Git - xonotic/xonstatdb.git/blob - scripts/refresh_active_maps_mv.sql
Add TKA to the full build.
[xonotic/xonstatdb.git] / scripts / refresh_active_maps_mv.sql
1 begin;
2     delete from active_maps_mv;
3
4     insert into active_maps_mv
5     select row_number() over(order by count(1) desc) sort_order, m.map_id, m.name, count(1) games
6     from maps m join games g on m.map_id = g.map_id
7     where g.create_dt >= now() at time zone 'UTC' - interval '1 week'
8     group by 2, 3
9     ;
10 end;