mirror of
https://codeberg.org/icewind/log-normalizer.git
synced 2026-11-30 18:50:49 +01:00
add drop attribution views
This commit is contained in:
parent
8c8a1bc303
commit
3c173f6663
1 changed files with 17 additions and 1 deletions
18
schema.sql
18
schema.sql
|
|
@ -523,4 +523,20 @@ GROUP BY
|
||||||
attacker,
|
attacker,
|
||||||
attacker_class;
|
attacker_class;
|
||||||
|
|
||||||
CREATE UNIQUE INDEX grouped_drop_kills_idx ON grouped_drop_kills USING BTREE (victim, attacker);
|
CREATE UNIQUE INDEX grouped_drop_kills_idx ON grouped_drop_kills USING BTREE (victim, attacker, attacker_class);
|
||||||
|
|
||||||
|
CREATE MATERIALIZED VIEW drop_attribution AS
|
||||||
|
SELECT
|
||||||
|
attacker,
|
||||||
|
victim,
|
||||||
|
json_objectagg (attacker_class:count) AS by_class,
|
||||||
|
sum(count) AS total
|
||||||
|
FROM
|
||||||
|
grouped_drop_kills
|
||||||
|
GROUP BY
|
||||||
|
victim,
|
||||||
|
attacker;
|
||||||
|
|
||||||
|
CREATE INDEX drop_attribution_victim_idx ON drop_attribution USING BTREE (victim, total DESC);
|
||||||
|
|
||||||
|
CREATE INDEX drop_attribution_attacker_idx ON drop_attribution USING BTREE (attacker, total DESC);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue