Skip to content

ClickHouse: user lookups and entity inspection cause full scans and saturate CPU #1004

Description

@CheekyNox

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

  1. Use a ClickHouse database with a substantial amount of CoreProtect history.
  2. Run:
/co lookup user:CheekyNox time:1d radius:#global
  1. Monitor ClickHouse CPU usage and system.query_log.

Entity inspection

  1. Enable /co inspect.
  2. Click an entity.
  3. Monitor ClickHouse CPU usage.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions