Compare commits

...

6 Commits

Author SHA1 Message Date
0eb8ecf506 prism 2026-01-28 06:32:31 +08:00
c434145fa1 prism 2026-01-28 05:59:46 +08:00
099266cd64 prism 2026-01-28 04:09:32 +08:00
ad1287d947 prism 2026-01-28 03:58:05 +08:00
fe694579f1 prism 2026-01-22 21:44:55 +08:00
7dbc3aefde prism 2026-01-22 21:39:46 +08:00

View File

@@ -1,9 +1,13 @@
-- 获取最新的数据 -- 获取最旧于最新的数据
select to_timestamp(max(timestamp)) select to_timestamp(min(timestamp)) as min, to_timestamp(max(timestamp)) as max
from activities; from activities;
-- 获取最旧的数据 -- 最大与最小id
select to_timestamp(min(timestamp)) select min(activity_id), max(activity_id)
from activities;
-- 数据总量
select max(activity_id) - min(activity_id) + 1
from activities; from activities;
-- 1天内的数据按action分组排序 -- 1天内的数据按action分组排序
@@ -182,6 +186,22 @@ where action_id = (select action_id from actions where action = 'item-dispense')
group by descriptor group by descriptor
order by count(descriptor) desc; order by count(descriptor) desc;
-- 1天内item-dispense行为按坐标分组
select world_id, x, y, z, count((world_id, x, y, z))
from activities
where action_id = (select action_id from actions where action = 'item-dispense')
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;
-- 1天内item-dispense行为按坐标与物品分组
select world_id, x, y, z, descriptor, count((world_id, x, y, z, descriptor))
from activities
where action_id = (select action_id from actions where action = 'item-dispense')
and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1
group by world_id, x, y, z, descriptor
order by count((world_id, x, y, z, descriptor)) desc;
-- 1天内发射的矿车按坐标分组 -- 1天内发射的矿车按坐标分组
select world_id, x, y, z, count((world_id, x, y, z)) select world_id, x, y, z, count((world_id, x, y, z))
from activities from activities
@@ -208,3 +228,11 @@ where action_id = (select action_id from actions where action = 'entity-death')
and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1 and timestamp > EXTRACT(EPOCH FROM current_timestamp(0))::bigint - 86400 * 1
group by affected_entity_type_id, entity_types.entity_type group by affected_entity_type_id, entity_types.entity_type
order by count(*) desc; order by count(*) desc;
-- 1天内的 block-form 行为按坐标分组
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-form')
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;