From 8603108d2ca8675a9867be119a0bb11653cce2da Mon Sep 17 00:00:00 2001 From: Fortern Date: Tue, 23 Dec 2025 04:01:15 +0800 Subject: [PATCH] prism --- PostgreSQL/prism/prism.sql | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/PostgreSQL/prism/prism.sql b/PostgreSQL/prism/prism.sql index 94b3066..36941e6 100644 --- a/PostgreSQL/prism/prism.sql +++ b/PostgreSQL/prism/prism.sql @@ -19,7 +19,7 @@ select cause_player_id, players.player, count(*) from activities left join players on activities.cause_player_id = players.player_id where action_id = (select action_id from actions where action = 'block-place') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by cause_player_id, player order by count(cause_player_id) desc; @@ -27,7 +27,7 @@ order by count(cause_player_id) desc; select * from activities where action_id = (select action_id from actions where action = 'block-place') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and cause_id is not null limit 500; @@ -36,7 +36,7 @@ select cause_entity_type_id, entity_type, count(*) from activities left join entity_types on activities.cause_entity_type_id = entity_types.entity_type_id where action_id = (select action_id from actions where action = 'block-place') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and cause_player_id is null group by cause_entity_type_id, entity_type order by count(cause_entity_type_id) desc; @@ -46,7 +46,7 @@ select activities.cause_id, causes.cause, count(*) from activities left join causes on activities.cause_id = causes.cause_id where action_id = (select action_id from actions where action = 'block-place') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and activities.cause_id is not null group by activities.cause_id, causes.cause order by count(activities.cause_id) desc; @@ -56,7 +56,7 @@ select world_id, x, y, z, count((world_id, x, y, z)) from activities where action_id = (select action_id from actions where action = 'block-place') and cause_id = (select cause_id from causes where cause = 'nature') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by world_id, x, y, z order by count((world_id, x, y, z)) desc; @@ -65,7 +65,7 @@ select world_id, x, y, z, count((world_id, x, y, z)) from activities where action_id = (select action_id from actions where action = 'block-place') and cause_id = (select cause_id from causes where cause = 'unknown') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by world_id, x, y, z order by count((world_id, x, y, z)) desc; @@ -74,7 +74,7 @@ select cause_player_id, players.player, count(*) from activities left join players on activities.cause_player_id = players.player_id where action_id = (select action_id from actions where action = 'block-break') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by cause_player_id, player order by count(cause_player_id) desc; @@ -83,7 +83,7 @@ select activities.cause_id, causes.cause, count(*) from activities left join causes on activities.cause_id = causes.cause_id where action_id = (select action_id from actions where action = 'block-break') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and activities.cause_player_id is null group by activities.cause_id, causes.cause order by count(activities.cause_id) desc; @@ -93,7 +93,7 @@ select activities.cause_entity_type_id, entity_types.entity_type, count(*) from activities left join entity_types on activities.cause_entity_type_id = entity_types.entity_type_id where action_id = (select action_id from actions where action = 'block-break') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and activities.cause_player_id is null group by activities.cause_entity_type_id, entity_types.entity_type order by count(activities.cause_id) desc; @@ -103,7 +103,7 @@ select world_id, x, y, z, count((world_id, x, y, z)) from activities where action_id = (select action_id from actions where action = 'block-break') and cause_entity_type_id = (select entity_type_id from entity_types where entity_type = 'breeze_wind_charge') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by world_id, x, y, z order by count((world_id, x, y, z)) desc; @@ -115,14 +115,14 @@ where action_id = (select action_id from actions where action = 'block-break') and cause_entity_type_id is null and cause_player_id is null and cause_id is null - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 limit 100; -- 1天内,发射器的数据,按发射的物品分组统计 select descriptor, count(*) from activities where action_id = 2 - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by descriptor order by count(descriptor) desc; @@ -130,7 +130,7 @@ order by count(descriptor) desc; select descriptor, count(*) from activities where action_id = 2 - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and descriptor = 'Shulker Box' group by descriptor order by count(descriptor) desc; @@ -140,6 +140,6 @@ select cause_player_id, players.player, count(*) from activities left join players on activities.cause_player_id = players.player_id where action_id = (select action_id from actions where action = 'entity-death') - and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 + and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 group by cause_player_id, player order by count(cause_player_id) desc;