Problem
Some lookup operations cause very high ClickHouse CPU usage, while location-based inspection remains fast.
Examples of expensive operations:
/co lookup user:CheekyNox time:1d radius:#global
Also, clicking an entity while using /co inspect causes a similar CPU spike.
For comparison:
- Inspecting a block is fast.
- Inspecting a chest is fast.
- Inspecting an entity causes high ClickHouse CPU usage.
- A global lookup filtered by player and time causes high ClickHouse CPU usage.
During these operations, clickhouse-server reaches approximately 2300% CPU and the host CPU usage reaches approximately 90–100%.
Steps to reproduce
Global player lookup
- Use a ClickHouse database with a substantial amount of CoreProtect history.
- Run:
/co lookup user:CheekyNox time:1d radius:#global
- Monitor ClickHouse CPU usage and
system.query_log.
Entity inspection
- Enable
/co inspect.
- Click an entity.
- Monitor ClickHouse CPU usage.
- Compare it with inspecting a normal block or chest.
Expected behavior
Queries limited to one player and one day, or one specific entity, should not scan a large part of the event history or saturate all CPU cores.
Actual behavior
Global player lookup and entity inspection cause very high ClickHouse CPU usage.
Location-based block and chest inspection does not show the same behavior.
Problem
Some lookup operations cause very high ClickHouse CPU usage, while location-based inspection remains fast.
Examples of expensive operations:
Also, clicking an entity while using
/co inspectcauses a similar CPU spike.For comparison:
During these operations,
clickhouse-serverreaches approximately 2300% CPU and the host CPU usage reaches approximately 90–100%.Steps to reproduce
Global player lookup
system.query_log.Entity inspection
/co inspect.Expected behavior
Queries limited to one player and one day, or one specific entity, should not scan a large part of the event history or saturate all CPU cores.
Actual behavior
Global player lookup and entity inspection cause very high ClickHouse CPU usage.
Location-based block and chest inspection does not show the same behavior.