CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' )
) INHERITS (games);
+CREATE TABLE IF NOT EXISTS xonstat.games_2021q1 (
+ CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2021q1_ix001 on games_2021q1(create_dt);
+CREATE INDEX games_2021q1_ix002 on games_2021q1 using gin(players);
+CREATE UNIQUE INDEX games_2021q1_pk on games_2021q1(game_id);
+ALTER TABLE games_2021q1 ADD PRIMARY KEY USING INDEX games_2021q1_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2021q2 (
+ CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2021q2_ix001 on games_2021q2(create_dt);
+CREATE INDEX games_2021q2_ix002 on games_2021q2 using gin(players);
+CREATE UNIQUE INDEX games_2021q2_pk on games_2021q2(game_id);
+ALTER TABLE games_2021q2 ADD PRIMARY KEY USING INDEX games_2021q2_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2021q3 (
+ CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2021q3_ix001 on games_2021q3(create_dt);
+CREATE INDEX games_2021q3_ix002 on games_2021q3 using gin(players);
+CREATE UNIQUE INDEX games_2021q3_pk on games_2021q3(game_id);
+ALTER TABLE games_2021q3 ADD PRIMARY KEY USING INDEX games_2021q3_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2021q4 (
+ CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2021q4_ix001 on games_2021q4(create_dt);
+CREATE INDEX games_2021q4_ix002 on games_2021q4 using gin(players);
+CREATE UNIQUE INDEX games_2021q4_pk on games_2021q4(game_id);
+ALTER TABLE games_2021q4 ADD PRIMARY KEY USING INDEX games_2021q4_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2022q1 (
+ CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2022q1_ix001 on games_2022q1(create_dt);
+CREATE INDEX games_2022q1_ix002 on games_2022q1 using gin(players);
+CREATE UNIQUE INDEX games_2022q1_pk on games_2022q1(game_id);
+ALTER TABLE games_2022q1 ADD PRIMARY KEY USING INDEX games_2022q1_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2022q2 (
+ CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2022q2_ix001 on games_2022q2(create_dt);
+CREATE INDEX games_2022q2_ix002 on games_2022q2 using gin(players);
+CREATE UNIQUE INDEX games_2022q2_pk on games_2022q2(game_id);
+ALTER TABLE games_2022q2 ADD PRIMARY KEY USING INDEX games_2022q2_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2022q3 (
+ CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2022q3_ix001 on games_2022q3(create_dt);
+CREATE INDEX games_2022q3_ix002 on games_2022q3 using gin(players);
+CREATE UNIQUE INDEX games_2022q3_pk on games_2022q3(game_id);
+ALTER TABLE games_2022q3 ADD PRIMARY KEY USING INDEX games_2022q3_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2022q4 (
+ CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2022q4_ix001 on games_2022q4(create_dt);
+CREATE INDEX games_2022q4_ix002 on games_2022q4 using gin(players);
+CREATE UNIQUE INDEX games_2022q4_pk on games_2022q4(game_id);
+ALTER TABLE games_2022q4 ADD PRIMARY KEY USING INDEX games_2022q4_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2023q1 (
+ CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2023q1_ix001 on games_2023q1(create_dt);
+CREATE INDEX games_2023q1_ix002 on games_2023q1 using gin(players);
+CREATE UNIQUE INDEX games_2023q1_pk on games_2023q1(game_id);
+ALTER TABLE games_2023q1 ADD PRIMARY KEY USING INDEX games_2023q1_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2023q2 (
+ CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2023q2_ix001 on games_2023q2(create_dt);
+CREATE INDEX games_2023q2_ix002 on games_2023q2 using gin(players);
+CREATE UNIQUE INDEX games_2023q2_pk on games_2023q2(game_id);
+ALTER TABLE games_2023q2 ADD PRIMARY KEY USING INDEX games_2023q2_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2023q3 (
+ CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2023q3_ix001 on games_2023q3(create_dt);
+CREATE INDEX games_2023q3_ix002 on games_2023q3 using gin(players);
+CREATE UNIQUE INDEX games_2023q3_pk on games_2023q3(game_id);
+ALTER TABLE games_2023q3 ADD PRIMARY KEY USING INDEX games_2023q3_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2023q4 (
+ CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2023q4_ix001 on games_2023q4(create_dt);
+CREATE INDEX games_2023q4_ix002 on games_2023q4 using gin(players);
+CREATE UNIQUE INDEX games_2023q4_pk on games_2023q4(game_id);
+ALTER TABLE games_2023q4 ADD PRIMARY KEY USING INDEX games_2023q4_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2024q1 (
+ CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2024q1_ix001 on games_2024q1(create_dt);
+CREATE INDEX games_2024q1_ix002 on games_2024q1 using gin(players);
+CREATE UNIQUE INDEX games_2024q1_pk on games_2024q1(game_id);
+ALTER TABLE games_2024q1 ADD PRIMARY KEY USING INDEX games_2024q1_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2024q2 (
+ CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2024q2_ix001 on games_2024q2(create_dt);
+CREATE INDEX games_2024q2_ix002 on games_2024q2 using gin(players);
+CREATE UNIQUE INDEX games_2024q2_pk on games_2024q2(game_id);
+ALTER TABLE games_2024q2 ADD PRIMARY KEY USING INDEX games_2024q2_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2024q3 (
+ CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2024q3_ix001 on games_2024q3(create_dt);
+CREATE INDEX games_2024q3_ix002 on games_2024q3 using gin(players);
+CREATE UNIQUE INDEX games_2024q3_pk on games_2024q3(game_id);
+ALTER TABLE games_2024q3 ADD PRIMARY KEY USING INDEX games_2024q3_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2024q4 (
+ CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2024q4_ix001 on games_2024q4(create_dt);
+CREATE INDEX games_2024q4_ix002 on games_2024q4 using gin(players);
+CREATE UNIQUE INDEX games_2024q4_pk on games_2024q4(game_id);
+ALTER TABLE games_2024q4 ADD PRIMARY KEY USING INDEX games_2024q4_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2025q1 (
+ CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2025q1_ix001 on games_2025q1(create_dt);
+CREATE INDEX games_2025q1_ix002 on games_2025q1 using gin(players);
+CREATE UNIQUE INDEX games_2025q1_pk on games_2025q1(game_id);
+ALTER TABLE games_2025q1 ADD PRIMARY KEY USING INDEX games_2025q1_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2025q2 (
+ CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2025q2_ix001 on games_2025q2(create_dt);
+CREATE INDEX games_2025q2_ix002 on games_2025q2 using gin(players);
+CREATE UNIQUE INDEX games_2025q2_pk on games_2025q2(game_id);
+ALTER TABLE games_2025q2 ADD PRIMARY KEY USING INDEX games_2025q2_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2025q3 (
+ CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2025q3_ix001 on games_2025q3(create_dt);
+CREATE INDEX games_2025q3_ix002 on games_2025q3 using gin(players);
+CREATE UNIQUE INDEX games_2025q3_pk on games_2025q3(game_id);
+ALTER TABLE games_2025q3 ADD PRIMARY KEY USING INDEX games_2025q3_pk;
+
+CREATE TABLE IF NOT EXISTS xonstat.games_2025q4 (
+ CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' )
+) INHERITS (games);
+
+CREATE INDEX games_2025q4_ix001 on games_2025q4(create_dt);
+CREATE INDEX games_2025q4_ix002 on games_2025q4 using gin(players);
+CREATE UNIQUE INDEX games_2025q4_pk on games_2025q4(game_id);
+ALTER TABLE games_2025q4 ADD PRIMARY KEY USING INDEX games_2025q4_pk;
+
CREATE INDEX player_game_frag_matrix_2020q4_ix001 on player_game_frag_matrix_2020q4(create_dt);
CREATE INDEX player_game_frag_matrix_2020q4_ix002 on player_game_frag_matrix_2020q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q1 (
+ CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2021q1_ix001 on player_game_frag_matrix_2021q1(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q2 (
+ CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2021q2_ix001 on player_game_frag_matrix_2021q2(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q3 (
+ CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2021q3_ix001 on player_game_frag_matrix_2021q3(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2021q4 (
+ CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2021q4_ix001 on player_game_frag_matrix_2021q4(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q1 (
+ CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2022q1_ix001 on player_game_frag_matrix_2022q1(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q2 (
+ CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2022q2_ix001 on player_game_frag_matrix_2022q2(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q3 (
+ CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2022q3_ix001 on player_game_frag_matrix_2022q3(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2022q4 (
+ CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2022q4_ix001 on player_game_frag_matrix_2022q4(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q1 (
+ CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2023q1_ix001 on player_game_frag_matrix_2023q1(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q2 (
+ CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2023q2_ix001 on player_game_frag_matrix_2023q2(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q3 (
+ CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2023q3_ix001 on player_game_frag_matrix_2023q3(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2023q4 (
+ CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2023q4_ix001 on player_game_frag_matrix_2023q4(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q1 (
+ CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2024q1_ix001 on player_game_frag_matrix_2024q1(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q2 (
+ CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2024q2_ix001 on player_game_frag_matrix_2024q2(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q3 (
+ CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2024q3_ix001 on player_game_frag_matrix_2024q3(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2024q4 (
+ CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2024q4_ix001 on player_game_frag_matrix_2024q4(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q1 (
+ CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2025q1_ix001 on player_game_frag_matrix_2025q1(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q2 (
+ CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2025q2_ix001 on player_game_frag_matrix_2025q2(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q3 (
+ CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2025q3_ix001 on player_game_frag_matrix_2025q3(create_dt);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_frag_matrix_2025q4 (
+ CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' )
+) INHERITS (player_game_frag_matrix);
+
+CREATE INDEX player_game_frag_matrix_2025q4_ix001 on player_game_frag_matrix_2025q4(create_dt);
+
OIDS=FALSE
);
-CREATE INDEX player_game_nonparticipant_ix01 on player_game_nonparticipantss(create_dt);
-CREATE INDEX player_game_nonparticipant_ix02 on player_game_nonparticipantss(game_id);
-CREATE INDEX player_game_nonparticipant_ix03 on player_game_nonparticipantss(player_id);
-ALTER TABLE xonstat.player_game_stats OWNER TO xonstat;
+CREATE INDEX player_game_nonparticipant_ix01 on player_game_nonparticipants(create_dt);
+CREATE INDEX player_game_nonparticipant_ix02 on player_game_nonparticipants(game_id);
+CREATE INDEX player_game_nonparticipant_ix03 on player_game_nonparticipants(player_id);
+ALTER TABLE xonstat.player_game_nonparticipants OWNER TO xonstat;
CREATE TABLE IF NOT EXISTS xonstat.player_game_nonparticipants_2020q4 (
CHECK ( create_dt >= DATE '2020-10-01' AND create_dt < DATE '2021-01-01' )
CREATE INDEX player_game_stats_2020q4_ix001 on player_game_stats_2020q4(create_dt);
CREATE INDEX player_game_stats_2020q4_ix002 on player_game_stats_2020q4(game_id);
CREATE INDEX player_game_stats_2020q4_ix003 on player_game_stats_2020q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q1 (
+ CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2021q1_ix001 on player_game_stats_2021q1(create_dt);
+CREATE INDEX player_game_stats_2021q1_ix002 on player_game_stats_2021q1(game_id);
+CREATE INDEX player_game_stats_2021q1_ix003 on player_game_stats_2021q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q2 (
+ CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2021q2_ix001 on player_game_stats_2021q2(create_dt);
+CREATE INDEX player_game_stats_2021q2_ix002 on player_game_stats_2021q2(game_id);
+CREATE INDEX player_game_stats_2021q2_ix003 on player_game_stats_2021q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q3 (
+ CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2021q3_ix001 on player_game_stats_2021q3(create_dt);
+CREATE INDEX player_game_stats_2021q3_ix002 on player_game_stats_2021q3(game_id);
+CREATE INDEX player_game_stats_2021q3_ix003 on player_game_stats_2021q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2021q4 (
+ CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2021q4_ix001 on player_game_stats_2021q4(create_dt);
+CREATE INDEX player_game_stats_2021q4_ix002 on player_game_stats_2021q4(game_id);
+CREATE INDEX player_game_stats_2021q4_ix003 on player_game_stats_2021q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q1 (
+ CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2022q1_ix001 on player_game_stats_2022q1(create_dt);
+CREATE INDEX player_game_stats_2022q1_ix002 on player_game_stats_2022q1(game_id);
+CREATE INDEX player_game_stats_2022q1_ix003 on player_game_stats_2022q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q2 (
+ CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2022q2_ix001 on player_game_stats_2022q2(create_dt);
+CREATE INDEX player_game_stats_2022q2_ix002 on player_game_stats_2022q2(game_id);
+CREATE INDEX player_game_stats_2022q2_ix003 on player_game_stats_2022q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q3 (
+ CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2022q3_ix001 on player_game_stats_2022q3(create_dt);
+CREATE INDEX player_game_stats_2022q3_ix002 on player_game_stats_2022q3(game_id);
+CREATE INDEX player_game_stats_2022q3_ix003 on player_game_stats_2022q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2022q4 (
+ CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2022q4_ix001 on player_game_stats_2022q4(create_dt);
+CREATE INDEX player_game_stats_2022q4_ix002 on player_game_stats_2022q4(game_id);
+CREATE INDEX player_game_stats_2022q4_ix003 on player_game_stats_2022q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q1 (
+ CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2023q1_ix001 on player_game_stats_2023q1(create_dt);
+CREATE INDEX player_game_stats_2023q1_ix002 on player_game_stats_2023q1(game_id);
+CREATE INDEX player_game_stats_2023q1_ix003 on player_game_stats_2023q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q2 (
+ CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2023q2_ix001 on player_game_stats_2023q2(create_dt);
+CREATE INDEX player_game_stats_2023q2_ix002 on player_game_stats_2023q2(game_id);
+CREATE INDEX player_game_stats_2023q2_ix003 on player_game_stats_2023q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q3 (
+ CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2023q3_ix001 on player_game_stats_2023q3(create_dt);
+CREATE INDEX player_game_stats_2023q3_ix002 on player_game_stats_2023q3(game_id);
+CREATE INDEX player_game_stats_2023q3_ix003 on player_game_stats_2023q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2023q4 (
+ CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2023q4_ix001 on player_game_stats_2023q4(create_dt);
+CREATE INDEX player_game_stats_2023q4_ix002 on player_game_stats_2023q4(game_id);
+CREATE INDEX player_game_stats_2023q4_ix003 on player_game_stats_2023q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q1 (
+ CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2024q1_ix001 on player_game_stats_2024q1(create_dt);
+CREATE INDEX player_game_stats_2024q1_ix002 on player_game_stats_2024q1(game_id);
+CREATE INDEX player_game_stats_2024q1_ix003 on player_game_stats_2024q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q2 (
+ CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2024q2_ix001 on player_game_stats_2024q2(create_dt);
+CREATE INDEX player_game_stats_2024q2_ix002 on player_game_stats_2024q2(game_id);
+CREATE INDEX player_game_stats_2024q2_ix003 on player_game_stats_2024q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q3 (
+ CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2024q3_ix001 on player_game_stats_2024q3(create_dt);
+CREATE INDEX player_game_stats_2024q3_ix002 on player_game_stats_2024q3(game_id);
+CREATE INDEX player_game_stats_2024q3_ix003 on player_game_stats_2024q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2024q4 (
+ CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2024q4_ix001 on player_game_stats_2024q4(create_dt);
+CREATE INDEX player_game_stats_2024q4_ix002 on player_game_stats_2024q4(game_id);
+CREATE INDEX player_game_stats_2024q4_ix003 on player_game_stats_2024q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q1 (
+ CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2025q1_ix001 on player_game_stats_2025q1(create_dt);
+CREATE INDEX player_game_stats_2025q1_ix002 on player_game_stats_2025q1(game_id);
+CREATE INDEX player_game_stats_2025q1_ix003 on player_game_stats_2025q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q2 (
+ CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2025q2_ix001 on player_game_stats_2025q2(create_dt);
+CREATE INDEX player_game_stats_2025q2_ix002 on player_game_stats_2025q2(game_id);
+CREATE INDEX player_game_stats_2025q2_ix003 on player_game_stats_2025q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q3 (
+ CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2025q3_ix001 on player_game_stats_2025q3(create_dt);
+CREATE INDEX player_game_stats_2025q3_ix002 on player_game_stats_2025q3(game_id);
+CREATE INDEX player_game_stats_2025q3_ix003 on player_game_stats_2025q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_game_stats_2025q4 (
+ CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' )
+) INHERITS (player_game_stats);
+
+CREATE INDEX player_game_stats_2025q4_ix001 on player_game_stats_2025q4(create_dt);
+CREATE INDEX player_game_stats_2025q4_ix002 on player_game_stats_2025q4(game_id);
+CREATE INDEX player_game_stats_2025q4_ix003 on player_game_stats_2025q4(player_id);
+
+
CREATE INDEX player_weapon_stats_2020q4_ix001 on player_weapon_stats_2020q4(create_dt);
CREATE INDEX player_weapon_stats_2020q4_ix002 on player_weapon_stats_2020q4(game_id);
CREATE INDEX player_weapon_stats_2020q4_ix003 on player_weapon_stats_2020q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q1 (
+ CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2021q1_ix001 on player_weapon_stats_2021q1(create_dt);
+CREATE INDEX player_weapon_stats_2021q1_ix002 on player_weapon_stats_2021q1(game_id);
+CREATE INDEX player_weapon_stats_2021q1_ix003 on player_weapon_stats_2021q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q2 (
+ CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2021q2_ix001 on player_weapon_stats_2021q2(create_dt);
+CREATE INDEX player_weapon_stats_2021q2_ix002 on player_weapon_stats_2021q2(game_id);
+CREATE INDEX player_weapon_stats_2021q2_ix003 on player_weapon_stats_2021q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q3 (
+ CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2021q3_ix001 on player_weapon_stats_2021q3(create_dt);
+CREATE INDEX player_weapon_stats_2021q3_ix002 on player_weapon_stats_2021q3(game_id);
+CREATE INDEX player_weapon_stats_2021q3_ix003 on player_weapon_stats_2021q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2021q4 (
+ CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2021q4_ix001 on player_weapon_stats_2021q4(create_dt);
+CREATE INDEX player_weapon_stats_2021q4_ix002 on player_weapon_stats_2021q4(game_id);
+CREATE INDEX player_weapon_stats_2021q4_ix003 on player_weapon_stats_2021q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q1 (
+ CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2022q1_ix001 on player_weapon_stats_2022q1(create_dt);
+CREATE INDEX player_weapon_stats_2022q1_ix002 on player_weapon_stats_2022q1(game_id);
+CREATE INDEX player_weapon_stats_2022q1_ix003 on player_weapon_stats_2022q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q2 (
+ CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2022q2_ix001 on player_weapon_stats_2022q2(create_dt);
+CREATE INDEX player_weapon_stats_2022q2_ix002 on player_weapon_stats_2022q2(game_id);
+CREATE INDEX player_weapon_stats_2022q2_ix003 on player_weapon_stats_2022q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q3 (
+ CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2022q3_ix001 on player_weapon_stats_2022q3(create_dt);
+CREATE INDEX player_weapon_stats_2022q3_ix002 on player_weapon_stats_2022q3(game_id);
+CREATE INDEX player_weapon_stats_2022q3_ix003 on player_weapon_stats_2022q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2022q4 (
+ CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2022q4_ix001 on player_weapon_stats_2022q4(create_dt);
+CREATE INDEX player_weapon_stats_2022q4_ix002 on player_weapon_stats_2022q4(game_id);
+CREATE INDEX player_weapon_stats_2022q4_ix003 on player_weapon_stats_2022q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q1 (
+ CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2023q1_ix001 on player_weapon_stats_2023q1(create_dt);
+CREATE INDEX player_weapon_stats_2023q1_ix002 on player_weapon_stats_2023q1(game_id);
+CREATE INDEX player_weapon_stats_2023q1_ix003 on player_weapon_stats_2023q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q2 (
+ CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2023q2_ix001 on player_weapon_stats_2023q2(create_dt);
+CREATE INDEX player_weapon_stats_2023q2_ix002 on player_weapon_stats_2023q2(game_id);
+CREATE INDEX player_weapon_stats_2023q2_ix003 on player_weapon_stats_2023q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q3 (
+ CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2023q3_ix001 on player_weapon_stats_2023q3(create_dt);
+CREATE INDEX player_weapon_stats_2023q3_ix002 on player_weapon_stats_2023q3(game_id);
+CREATE INDEX player_weapon_stats_2023q3_ix003 on player_weapon_stats_2023q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2023q4 (
+ CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2023q4_ix001 on player_weapon_stats_2023q4(create_dt);
+CREATE INDEX player_weapon_stats_2023q4_ix002 on player_weapon_stats_2023q4(game_id);
+CREATE INDEX player_weapon_stats_2023q4_ix003 on player_weapon_stats_2023q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q1 (
+ CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2024q1_ix001 on player_weapon_stats_2024q1(create_dt);
+CREATE INDEX player_weapon_stats_2024q1_ix002 on player_weapon_stats_2024q1(game_id);
+CREATE INDEX player_weapon_stats_2024q1_ix003 on player_weapon_stats_2024q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q2 (
+ CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2024q2_ix001 on player_weapon_stats_2024q2(create_dt);
+CREATE INDEX player_weapon_stats_2024q2_ix002 on player_weapon_stats_2024q2(game_id);
+CREATE INDEX player_weapon_stats_2024q2_ix003 on player_weapon_stats_2024q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q3 (
+ CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2024q3_ix001 on player_weapon_stats_2024q3(create_dt);
+CREATE INDEX player_weapon_stats_2024q3_ix002 on player_weapon_stats_2024q3(game_id);
+CREATE INDEX player_weapon_stats_2024q3_ix003 on player_weapon_stats_2024q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2024q4 (
+ CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2024q4_ix001 on player_weapon_stats_2024q4(create_dt);
+CREATE INDEX player_weapon_stats_2024q4_ix002 on player_weapon_stats_2024q4(game_id);
+CREATE INDEX player_weapon_stats_2024q4_ix003 on player_weapon_stats_2024q4(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q1 (
+ CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2025q1_ix001 on player_weapon_stats_2025q1(create_dt);
+CREATE INDEX player_weapon_stats_2025q1_ix002 on player_weapon_stats_2025q1(game_id);
+CREATE INDEX player_weapon_stats_2025q1_ix003 on player_weapon_stats_2025q1(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q2 (
+ CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2025q2_ix001 on player_weapon_stats_2025q2(create_dt);
+CREATE INDEX player_weapon_stats_2025q2_ix002 on player_weapon_stats_2025q2(game_id);
+CREATE INDEX player_weapon_stats_2025q2_ix003 on player_weapon_stats_2025q2(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q3 (
+ CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2025q3_ix001 on player_weapon_stats_2025q3(create_dt);
+CREATE INDEX player_weapon_stats_2025q3_ix002 on player_weapon_stats_2025q3(game_id);
+CREATE INDEX player_weapon_stats_2025q3_ix003 on player_weapon_stats_2025q3(player_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.player_weapon_stats_2025q4 (
+ CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' )
+) INHERITS (player_weapon_stats);
+
+CREATE INDEX player_weapon_stats_2025q4_ix001 on player_weapon_stats_2025q4(create_dt);
+CREATE INDEX player_weapon_stats_2025q4_ix002 on player_weapon_stats_2025q4(game_id);
+CREATE INDEX player_weapon_stats_2025q4_ix003 on player_weapon_stats_2025q4(player_id);
+
+
CREATE INDEX team_game_stats_2020q4_ix001 on team_game_stats_2020q4(create_dt);
CREATE INDEX team_game_stats_2020q4_ix002 on team_game_stats_2020q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q1 (
+ CHECK ( create_dt >= DATE '2021-01-01' AND create_dt < DATE '2021-04-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2021q1_ix001 on team_game_stats_2021q1(create_dt);
+CREATE INDEX team_game_stats_2021q1_ix002 on team_game_stats_2021q1(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q2 (
+ CHECK ( create_dt >= DATE '2021-04-01' AND create_dt < DATE '2021-07-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2021q2_ix001 on team_game_stats_2021q2(create_dt);
+CREATE INDEX team_game_stats_2021q2_ix002 on team_game_stats_2021q2(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q3 (
+ CHECK ( create_dt >= DATE '2021-07-01' AND create_dt < DATE '2021-10-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2021q3_ix001 on team_game_stats_2021q3(create_dt);
+CREATE INDEX team_game_stats_2021q3_ix002 on team_game_stats_2021q3(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2021q4 (
+ CHECK ( create_dt >= DATE '2021-10-01' AND create_dt < DATE '2022-01-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2021q4_ix001 on team_game_stats_2021q4(create_dt);
+CREATE INDEX team_game_stats_2021q4_ix002 on team_game_stats_2021q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q1 (
+ CHECK ( create_dt >= DATE '2022-01-01' AND create_dt < DATE '2022-04-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2022q1_ix001 on team_game_stats_2022q1(create_dt);
+CREATE INDEX team_game_stats_2022q1_ix002 on team_game_stats_2022q1(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q2 (
+ CHECK ( create_dt >= DATE '2022-04-01' AND create_dt < DATE '2022-07-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2022q2_ix001 on team_game_stats_2022q2(create_dt);
+CREATE INDEX team_game_stats_2022q2_ix002 on team_game_stats_2022q2(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q3 (
+ CHECK ( create_dt >= DATE '2022-07-01' AND create_dt < DATE '2022-10-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2022q3_ix001 on team_game_stats_2022q3(create_dt);
+CREATE INDEX team_game_stats_2022q3_ix002 on team_game_stats_2022q3(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2022q4 (
+ CHECK ( create_dt >= DATE '2022-10-01' AND create_dt < DATE '2023-01-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2022q4_ix001 on team_game_stats_2022q4(create_dt);
+CREATE INDEX team_game_stats_2022q4_ix002 on team_game_stats_2022q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q1 (
+ CHECK ( create_dt >= DATE '2023-01-01' AND create_dt < DATE '2023-04-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2023q1_ix001 on team_game_stats_2023q1(create_dt);
+CREATE INDEX team_game_stats_2023q1_ix002 on team_game_stats_2023q1(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q2 (
+ CHECK ( create_dt >= DATE '2023-04-01' AND create_dt < DATE '2023-07-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2023q2_ix001 on team_game_stats_2023q2(create_dt);
+CREATE INDEX team_game_stats_2023q2_ix002 on team_game_stats_2023q2(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q3 (
+ CHECK ( create_dt >= DATE '2023-07-01' AND create_dt < DATE '2023-10-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2023q3_ix001 on team_game_stats_2023q3(create_dt);
+CREATE INDEX team_game_stats_2023q3_ix002 on team_game_stats_2023q3(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2023q4 (
+ CHECK ( create_dt >= DATE '2023-10-01' AND create_dt < DATE '2024-01-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2023q4_ix001 on team_game_stats_2023q4(create_dt);
+CREATE INDEX team_game_stats_2023q4_ix002 on team_game_stats_2023q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q1 (
+ CHECK ( create_dt >= DATE '2024-01-01' AND create_dt < DATE '2024-04-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2024q1_ix001 on team_game_stats_2024q1(create_dt);
+CREATE INDEX team_game_stats_2024q1_ix002 on team_game_stats_2024q1(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q2 (
+ CHECK ( create_dt >= DATE '2024-04-01' AND create_dt < DATE '2024-07-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2024q2_ix001 on team_game_stats_2024q2(create_dt);
+CREATE INDEX team_game_stats_2024q2_ix002 on team_game_stats_2024q2(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q3 (
+ CHECK ( create_dt >= DATE '2024-07-01' AND create_dt < DATE '2024-10-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2024q3_ix001 on team_game_stats_2024q3(create_dt);
+CREATE INDEX team_game_stats_2024q3_ix002 on team_game_stats_2024q3(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2024q4 (
+ CHECK ( create_dt >= DATE '2024-10-01' AND create_dt < DATE '2025-01-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2024q4_ix001 on team_game_stats_2024q4(create_dt);
+CREATE INDEX team_game_stats_2024q4_ix002 on team_game_stats_2024q4(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q1 (
+ CHECK ( create_dt >= DATE '2025-01-01' AND create_dt < DATE '2025-04-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2025q1_ix001 on team_game_stats_2025q1(create_dt);
+CREATE INDEX team_game_stats_2025q1_ix002 on team_game_stats_2025q1(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q2 (
+ CHECK ( create_dt >= DATE '2025-04-01' AND create_dt < DATE '2025-07-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2025q2_ix001 on team_game_stats_2025q2(create_dt);
+CREATE INDEX team_game_stats_2025q2_ix002 on team_game_stats_2025q2(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q3 (
+ CHECK ( create_dt >= DATE '2025-07-01' AND create_dt < DATE '2025-10-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2025q3_ix001 on team_game_stats_2025q3(create_dt);
+CREATE INDEX team_game_stats_2025q3_ix002 on team_game_stats_2025q3(game_id);
+
+CREATE TABLE IF NOT EXISTS xonstat.team_game_stats_2025q4 (
+ CHECK ( create_dt >= DATE '2025-10-01' AND create_dt < DATE '2026-01-01' )
+) INHERITS (team_game_stats);
+
+CREATE INDEX team_game_stats_2025q4_ix001 on team_game_stats_2025q4(create_dt);
+CREATE INDEX team_game_stats_2025q4_ix002 on team_game_stats_2025q4(game_id);
+
CREATE OR REPLACE FUNCTION games_ins()
RETURNS TRIGGER AS $$
BEGIN
- IF (NEW.create_dt >= DATE '2014-01-01' AND NEW.create_dt < DATE '2014-04-01') THEN
- INSERT INTO games_2014Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-04-01' AND NEW.create_dt < DATE '2014-07-01') THEN
- INSERT INTO games_2014Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-07-01' AND NEW.create_dt < DATE '2014-10-01') THEN
- INSERT INTO games_2014Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-10-01' AND NEW.create_dt < DATE '2015-01-01') THEN
- INSERT INTO games_2014Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-01-01' AND NEW.create_dt < DATE '2015-04-01') THEN
- INSERT INTO games_2015Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-04-01' AND NEW.create_dt < DATE '2015-07-01') THEN
- INSERT INTO games_2015Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-07-01' AND NEW.create_dt < DATE '2015-10-01') THEN
- INSERT INTO games_2015Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-10-01' AND NEW.create_dt < DATE '2016-01-01') THEN
- INSERT INTO games_2015Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-01-01' AND NEW.create_dt < DATE '2016-04-01') THEN
- INSERT INTO games_2016Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-04-01' AND NEW.create_dt < DATE '2016-07-01') THEN
- INSERT INTO games_2016Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-07-01' AND NEW.create_dt < DATE '2016-10-01') THEN
- INSERT INTO games_2016Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-10-01' AND NEW.create_dt < DATE '2017-01-01') THEN
- INSERT INTO games_2016Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-01-01' AND NEW.create_dt < DATE '2017-04-01') THEN
- INSERT INTO games_2017Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-04-01' AND NEW.create_dt < DATE '2017-07-01') THEN
- INSERT INTO games_2017Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-07-01' AND NEW.create_dt < DATE '2017-10-01') THEN
- INSERT INTO games_2017Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-10-01' AND NEW.create_dt < DATE '2018-01-01') THEN
- INSERT INTO games_2017Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-01-01' AND NEW.create_dt < DATE '2018-04-01') THEN
- INSERT INTO games_2018Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-04-01' AND NEW.create_dt < DATE '2018-07-01') THEN
- INSERT INTO games_2018Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-07-01' AND NEW.create_dt < DATE '2018-10-01') THEN
- INSERT INTO games_2018Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-10-01' AND NEW.create_dt < DATE '2019-01-01') THEN
- INSERT INTO games_2018Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-01-01' AND NEW.create_dt < DATE '2019-04-01') THEN
- INSERT INTO games_2019Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-04-01' AND NEW.create_dt < DATE '2019-07-01') THEN
- INSERT INTO games_2019Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-07-01' AND NEW.create_dt < DATE '2019-10-01') THEN
- INSERT INTO games_2019Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-10-01' AND NEW.create_dt < DATE '2020-01-01') THEN
- INSERT INTO games_2019Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
+ IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
INSERT INTO games_2020Q1 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN
INSERT INTO games_2020Q2 VALUES (NEW.*);
INSERT INTO games_2020Q3 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN
INSERT INTO games_2020Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN
+ INSERT INTO games_2021Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN
+ INSERT INTO games_2021Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN
+ INSERT INTO games_2021Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN
+ INSERT INTO games_2021Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN
+ INSERT INTO games_2022Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN
+ INSERT INTO games_2022Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN
+ INSERT INTO games_2022Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN
+ INSERT INTO games_2022Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN
+ INSERT INTO games_2023Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN
+ INSERT INTO games_2023Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN
+ INSERT INTO games_2023Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN
+ INSERT INTO games_2023Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN
+ INSERT INTO games_2024Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN
+ INSERT INTO games_2024Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN
+ INSERT INTO games_2024Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN
+ INSERT INTO games_2024Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN
+ INSERT INTO games_2025Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN
+ INSERT INTO games_2025Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN
+ INSERT INTO games_2025Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN
+ INSERT INTO games_2025Q4 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the games_ins() trigger!';
END IF;
$$
LANGUAGE plpgsql;
+
DROP TRIGGER IF EXISTS games_ins_trg ON xonstat.games;
CREATE TRIGGER games_ins_trg
BEFORE INSERT on xonstat.games
CREATE OR REPLACE FUNCTION player_game_frag_matrix_ins()
RETURNS TRIGGER AS $$
BEGIN
- IF (NEW.create_dt >= DATE '2017-10-01' AND NEW.create_dt < DATE '2018-01-01') THEN
- INSERT INTO player_game_frag_matrix_2017Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-01-01' AND NEW.create_dt < DATE '2018-04-01') THEN
- INSERT INTO player_game_frag_matrix_2018Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-04-01' AND NEW.create_dt < DATE '2018-07-01') THEN
- INSERT INTO player_game_frag_matrix_2018Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-07-01' AND NEW.create_dt < DATE '2018-10-01') THEN
- INSERT INTO player_game_frag_matrix_2018Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-10-01' AND NEW.create_dt < DATE '2019-01-01') THEN
- INSERT INTO player_game_frag_matrix_2018Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-01-01' AND NEW.create_dt < DATE '2019-04-01') THEN
- INSERT INTO player_game_frag_matrix_2019Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-04-01' AND NEW.create_dt < DATE '2019-07-01') THEN
- INSERT INTO player_game_frag_matrix_2019Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-07-01' AND NEW.create_dt < DATE '2019-10-01') THEN
- INSERT INTO player_game_frag_matrix_2019Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-10-01' AND NEW.create_dt < DATE '2020-01-01') THEN
- INSERT INTO player_game_frag_matrix_2019Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
+ IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
INSERT INTO player_game_frag_matrix_2020Q1 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN
INSERT INTO player_game_frag_matrix_2020Q2 VALUES (NEW.*);
INSERT INTO player_game_frag_matrix_2020Q3 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN
INSERT INTO player_game_frag_matrix_2020Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN
+ INSERT INTO player_game_frag_matrix_2021Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN
+ INSERT INTO player_game_frag_matrix_2021Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN
+ INSERT INTO player_game_frag_matrix_2021Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN
+ INSERT INTO player_game_frag_matrix_2021Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN
+ INSERT INTO player_game_frag_matrix_2022Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN
+ INSERT INTO player_game_frag_matrix_2022Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN
+ INSERT INTO player_game_frag_matrix_2022Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN
+ INSERT INTO player_game_frag_matrix_2022Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN
+ INSERT INTO player_game_frag_matrix_2023Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN
+ INSERT INTO player_game_frag_matrix_2023Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN
+ INSERT INTO player_game_frag_matrix_2023Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN
+ INSERT INTO player_game_frag_matrix_2023Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN
+ INSERT INTO player_game_frag_matrix_2024Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN
+ INSERT INTO player_game_frag_matrix_2024Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN
+ INSERT INTO player_game_frag_matrix_2024Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN
+ INSERT INTO player_game_frag_matrix_2024Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN
+ INSERT INTO player_game_frag_matrix_2025Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN
+ INSERT INTO player_game_frag_matrix_2025Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN
+ INSERT INTO player_game_frag_matrix_2025Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN
+ INSERT INTO player_game_frag_matrix_2025Q4 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the player_game_frag_matrix_ins() trigger!';
END IF;
CREATE OR REPLACE FUNCTION player_game_stats_ins()
RETURNS TRIGGER AS $$
BEGIN
- IF (NEW.create_dt >= DATE '2014-01-01' AND NEW.create_dt < DATE '2014-04-01') THEN
- INSERT INTO player_game_stats_2014Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-04-01' AND NEW.create_dt < DATE '2014-07-01') THEN
- INSERT INTO player_game_stats_2014Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-07-01' AND NEW.create_dt < DATE '2014-10-01') THEN
- INSERT INTO player_game_stats_2014Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-10-01' AND NEW.create_dt < DATE '2015-01-01') THEN
- INSERT INTO player_game_stats_2014Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-01-01' AND NEW.create_dt < DATE '2015-04-01') THEN
- INSERT INTO player_game_stats_2015Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-04-01' AND NEW.create_dt < DATE '2015-07-01') THEN
- INSERT INTO player_game_stats_2015Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-07-01' AND NEW.create_dt < DATE '2015-10-01') THEN
- INSERT INTO player_game_stats_2015Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-10-01' AND NEW.create_dt < DATE '2016-01-01') THEN
- INSERT INTO player_game_stats_2015Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-01-01' AND NEW.create_dt < DATE '2016-04-01') THEN
- INSERT INTO player_game_stats_2016Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-04-01' AND NEW.create_dt < DATE '2016-07-01') THEN
- INSERT INTO player_game_stats_2016Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-07-01' AND NEW.create_dt < DATE '2016-10-01') THEN
- INSERT INTO player_game_stats_2016Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-10-01' AND NEW.create_dt < DATE '2017-01-01') THEN
- INSERT INTO player_game_stats_2016Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-01-01' AND NEW.create_dt < DATE '2017-04-01') THEN
- INSERT INTO player_game_stats_2017Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-04-01' AND NEW.create_dt < DATE '2017-07-01') THEN
- INSERT INTO player_game_stats_2017Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-07-01' AND NEW.create_dt < DATE '2017-10-01') THEN
- INSERT INTO player_game_stats_2017Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-10-01' AND NEW.create_dt < DATE '2018-01-01') THEN
- INSERT INTO player_game_stats_2017Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-01-01' AND NEW.create_dt < DATE '2018-04-01') THEN
- INSERT INTO player_game_stats_2018Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-04-01' AND NEW.create_dt < DATE '2018-07-01') THEN
- INSERT INTO player_game_stats_2018Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-07-01' AND NEW.create_dt < DATE '2018-10-01') THEN
- INSERT INTO player_game_stats_2018Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-10-01' AND NEW.create_dt < DATE '2019-01-01') THEN
- INSERT INTO player_game_stats_2018Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-01-01' AND NEW.create_dt < DATE '2019-04-01') THEN
- INSERT INTO player_game_stats_2019Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-04-01' AND NEW.create_dt < DATE '2019-07-01') THEN
- INSERT INTO player_game_stats_2019Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-07-01' AND NEW.create_dt < DATE '2019-10-01') THEN
- INSERT INTO player_game_stats_2019Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-10-01' AND NEW.create_dt < DATE '2020-01-01') THEN
- INSERT INTO player_game_stats_2019Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
+ IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
INSERT INTO player_game_stats_2020Q1 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN
INSERT INTO player_game_stats_2020Q2 VALUES (NEW.*);
INSERT INTO player_game_stats_2020Q3 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN
INSERT INTO player_game_stats_2020Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN
+ INSERT INTO player_game_stats_2021Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN
+ INSERT INTO player_game_stats_2021Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN
+ INSERT INTO player_game_stats_2021Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN
+ INSERT INTO player_game_stats_2021Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN
+ INSERT INTO player_game_stats_2022Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN
+ INSERT INTO player_game_stats_2022Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN
+ INSERT INTO player_game_stats_2022Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN
+ INSERT INTO player_game_stats_2022Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN
+ INSERT INTO player_game_stats_2023Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN
+ INSERT INTO player_game_stats_2023Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN
+ INSERT INTO player_game_stats_2023Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN
+ INSERT INTO player_game_stats_2023Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN
+ INSERT INTO player_game_stats_2024Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN
+ INSERT INTO player_game_stats_2024Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN
+ INSERT INTO player_game_stats_2024Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN
+ INSERT INTO player_game_stats_2024Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN
+ INSERT INTO player_game_stats_2025Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN
+ INSERT INTO player_game_stats_2025Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN
+ INSERT INTO player_game_stats_2025Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN
+ INSERT INTO player_game_stats_2025Q4 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the player_game_stats_ins() trigger!';
END IF;
CREATE OR REPLACE FUNCTION player_weapon_stats_ins()
RETURNS TRIGGER AS $$
BEGIN
- IF (NEW.create_dt >= DATE '2014-01-01' AND NEW.create_dt < DATE '2014-04-01') THEN
- INSERT INTO player_weapon_stats_2014Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-04-01' AND NEW.create_dt < DATE '2014-07-01') THEN
- INSERT INTO player_weapon_stats_2014Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-07-01' AND NEW.create_dt < DATE '2014-10-01') THEN
- INSERT INTO player_weapon_stats_2014Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-10-01' AND NEW.create_dt < DATE '2015-01-01') THEN
- INSERT INTO player_weapon_stats_2014Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-01-01' AND NEW.create_dt < DATE '2015-04-01') THEN
- INSERT INTO player_weapon_stats_2015Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-04-01' AND NEW.create_dt < DATE '2015-07-01') THEN
- INSERT INTO player_weapon_stats_2015Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-07-01' AND NEW.create_dt < DATE '2015-10-01') THEN
- INSERT INTO player_weapon_stats_2015Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-10-01' AND NEW.create_dt < DATE '2016-01-01') THEN
- INSERT INTO player_weapon_stats_2015Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-01-01' AND NEW.create_dt < DATE '2016-04-01') THEN
- INSERT INTO player_weapon_stats_2016Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-04-01' AND NEW.create_dt < DATE '2016-07-01') THEN
- INSERT INTO player_weapon_stats_2016Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-07-01' AND NEW.create_dt < DATE '2016-10-01') THEN
- INSERT INTO player_weapon_stats_2016Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-10-01' AND NEW.create_dt < DATE '2017-01-01') THEN
- INSERT INTO player_weapon_stats_2016Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-01-01' AND NEW.create_dt < DATE '2017-04-01') THEN
- INSERT INTO player_weapon_stats_2017Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-04-01' AND NEW.create_dt < DATE '2017-07-01') THEN
- INSERT INTO player_weapon_stats_2017Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-07-01' AND NEW.create_dt < DATE '2017-10-01') THEN
- INSERT INTO player_weapon_stats_2017Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-10-01' AND NEW.create_dt < DATE '2018-01-01') THEN
- INSERT INTO player_weapon_stats_2017Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-01-01' AND NEW.create_dt < DATE '2018-04-01') THEN
- INSERT INTO player_weapon_stats_2018Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-04-01' AND NEW.create_dt < DATE '2018-07-01') THEN
- INSERT INTO player_weapon_stats_2018Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-07-01' AND NEW.create_dt < DATE '2018-10-01') THEN
- INSERT INTO player_weapon_stats_2018Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-10-01' AND NEW.create_dt < DATE '2019-01-01') THEN
- INSERT INTO player_weapon_stats_2018Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-01-01' AND NEW.create_dt < DATE '2019-04-01') THEN
- INSERT INTO player_weapon_stats_2019Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-04-01' AND NEW.create_dt < DATE '2019-07-01') THEN
- INSERT INTO player_weapon_stats_2019Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-07-01' AND NEW.create_dt < DATE '2019-10-01') THEN
- INSERT INTO player_weapon_stats_2019Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-10-01' AND NEW.create_dt < DATE '2020-01-01') THEN
- INSERT INTO player_weapon_stats_2019Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
+ IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
INSERT INTO player_weapon_stats_2020Q1 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN
INSERT INTO player_weapon_stats_2020Q2 VALUES (NEW.*);
INSERT INTO player_weapon_stats_2020Q3 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN
INSERT INTO player_weapon_stats_2020Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN
+ INSERT INTO player_weapon_stats_2021Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN
+ INSERT INTO player_weapon_stats_2021Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN
+ INSERT INTO player_weapon_stats_2021Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN
+ INSERT INTO player_weapon_stats_2021Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN
+ INSERT INTO player_weapon_stats_2022Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN
+ INSERT INTO player_weapon_stats_2022Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN
+ INSERT INTO player_weapon_stats_2022Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN
+ INSERT INTO player_weapon_stats_2022Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN
+ INSERT INTO player_weapon_stats_2023Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN
+ INSERT INTO player_weapon_stats_2023Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN
+ INSERT INTO player_weapon_stats_2023Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN
+ INSERT INTO player_weapon_stats_2023Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN
+ INSERT INTO player_weapon_stats_2024Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN
+ INSERT INTO player_weapon_stats_2024Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN
+ INSERT INTO player_weapon_stats_2024Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN
+ INSERT INTO player_weapon_stats_2024Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN
+ INSERT INTO player_weapon_stats_2025Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN
+ INSERT INTO player_weapon_stats_2025Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN
+ INSERT INTO player_weapon_stats_2025Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN
+ INSERT INTO player_weapon_stats_2025Q4 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the player_weapon_stats_ins() trigger!';
END IF;
CREATE OR REPLACE FUNCTION team_game_stats_ins()
RETURNS TRIGGER AS $$
BEGIN
- IF (NEW.create_dt >= DATE '2014-01-01' AND NEW.create_dt < DATE '2014-04-01') THEN
- INSERT INTO team_game_stats_2014Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-04-01' AND NEW.create_dt < DATE '2014-07-01') THEN
- INSERT INTO team_game_stats_2014Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-07-01' AND NEW.create_dt < DATE '2014-10-01') THEN
- INSERT INTO team_game_stats_2014Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2014-10-01' AND NEW.create_dt < DATE '2015-01-01') THEN
- INSERT INTO team_game_stats_2014Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-01-01' AND NEW.create_dt < DATE '2015-04-01') THEN
- INSERT INTO team_game_stats_2015Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-04-01' AND NEW.create_dt < DATE '2015-07-01') THEN
- INSERT INTO team_game_stats_2015Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-07-01' AND NEW.create_dt < DATE '2015-10-01') THEN
- INSERT INTO team_game_stats_2015Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2015-10-01' AND NEW.create_dt < DATE '2016-01-01') THEN
- INSERT INTO team_game_stats_2015Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-01-01' AND NEW.create_dt < DATE '2016-04-01') THEN
- INSERT INTO team_game_stats_2016Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-04-01' AND NEW.create_dt < DATE '2016-07-01') THEN
- INSERT INTO team_game_stats_2016Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-07-01' AND NEW.create_dt < DATE '2016-10-01') THEN
- INSERT INTO team_game_stats_2016Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2016-10-01' AND NEW.create_dt < DATE '2017-01-01') THEN
- INSERT INTO team_game_stats_2016Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-01-01' AND NEW.create_dt < DATE '2017-04-01') THEN
- INSERT INTO team_game_stats_2017Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-04-01' AND NEW.create_dt < DATE '2017-07-01') THEN
- INSERT INTO team_game_stats_2017Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-07-01' AND NEW.create_dt < DATE '2017-10-01') THEN
- INSERT INTO team_game_stats_2017Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2017-10-01' AND NEW.create_dt < DATE '2018-01-01') THEN
- INSERT INTO team_game_stats_2017Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-01-01' AND NEW.create_dt < DATE '2018-04-01') THEN
- INSERT INTO team_game_stats_2018Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-04-01' AND NEW.create_dt < DATE '2018-07-01') THEN
- INSERT INTO team_game_stats_2018Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-07-01' AND NEW.create_dt < DATE '2018-10-01') THEN
- INSERT INTO team_game_stats_2018Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2018-10-01' AND NEW.create_dt < DATE '2019-01-01') THEN
- INSERT INTO team_game_stats_2018Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-01-01' AND NEW.create_dt < DATE '2019-04-01') THEN
- INSERT INTO team_game_stats_2019Q1 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-04-01' AND NEW.create_dt < DATE '2019-07-01') THEN
- INSERT INTO team_game_stats_2019Q2 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-07-01' AND NEW.create_dt < DATE '2019-10-01') THEN
- INSERT INTO team_game_stats_2019Q3 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2019-10-01' AND NEW.create_dt < DATE '2020-01-01') THEN
- INSERT INTO team_game_stats_2019Q4 VALUES (NEW.*);
- ELSIF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
+ IF (NEW.create_dt >= DATE '2020-01-01' AND NEW.create_dt < DATE '2020-04-01') THEN
INSERT INTO team_game_stats_2020Q1 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-04-01' AND NEW.create_dt < DATE '2020-07-01') THEN
INSERT INTO team_game_stats_2020Q2 VALUES (NEW.*);
INSERT INTO team_game_stats_2020Q3 VALUES (NEW.*);
ELSIF (NEW.create_dt >= DATE '2020-10-01' AND NEW.create_dt < DATE '2021-01-01') THEN
INSERT INTO team_game_stats_2020Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-01-01' AND NEW.create_dt < DATE '2021-04-01') THEN
+ INSERT INTO team_game_stats_2021Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-04-01' AND NEW.create_dt < DATE '2021-07-01') THEN
+ INSERT INTO team_game_stats_2021Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-07-01' AND NEW.create_dt < DATE '2021-10-01') THEN
+ INSERT INTO team_game_stats_2021Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2021-10-01' AND NEW.create_dt < DATE '2022-01-01') THEN
+ INSERT INTO team_game_stats_2021Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-01-01' AND NEW.create_dt < DATE '2022-04-01') THEN
+ INSERT INTO team_game_stats_2022Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-04-01' AND NEW.create_dt < DATE '2022-07-01') THEN
+ INSERT INTO team_game_stats_2022Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-07-01' AND NEW.create_dt < DATE '2022-10-01') THEN
+ INSERT INTO team_game_stats_2022Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2022-10-01' AND NEW.create_dt < DATE '2023-01-01') THEN
+ INSERT INTO team_game_stats_2022Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-01-01' AND NEW.create_dt < DATE '2023-04-01') THEN
+ INSERT INTO team_game_stats_2023Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-04-01' AND NEW.create_dt < DATE '2023-07-01') THEN
+ INSERT INTO team_game_stats_2023Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-07-01' AND NEW.create_dt < DATE '2023-10-01') THEN
+ INSERT INTO team_game_stats_2023Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2023-10-01' AND NEW.create_dt < DATE '2024-01-01') THEN
+ INSERT INTO team_game_stats_2023Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-01-01' AND NEW.create_dt < DATE '2024-04-01') THEN
+ INSERT INTO team_game_stats_2024Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-04-01' AND NEW.create_dt < DATE '2024-07-01') THEN
+ INSERT INTO team_game_stats_2024Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-07-01' AND NEW.create_dt < DATE '2024-10-01') THEN
+ INSERT INTO team_game_stats_2024Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2024-10-01' AND NEW.create_dt < DATE '2025-01-01') THEN
+ INSERT INTO team_game_stats_2024Q4 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-01-01' AND NEW.create_dt < DATE '2025-04-01') THEN
+ INSERT INTO team_game_stats_2025Q1 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-04-01' AND NEW.create_dt < DATE '2025-07-01') THEN
+ INSERT INTO team_game_stats_2025Q2 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-07-01' AND NEW.create_dt < DATE '2025-10-01') THEN
+ INSERT INTO team_game_stats_2025Q3 VALUES (NEW.*);
+ ELSIF (NEW.create_dt >= DATE '2025-10-01' AND NEW.create_dt < DATE '2026-01-01') THEN
+ INSERT INTO team_game_stats_2025Q4 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the team_game_stats_ins() trigger!';
END IF;