Compare commits
6 Commits
612612b37a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0eb8ecf506 | |||
| c434145fa1 | |||
| 099266cd64 | |||
| ad1287d947 | |||
| fe694579f1 | |||
| 7dbc3aefde |
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user