Skip to content

Instantly share code, notes, and snippets.

@REASY
Created October 22, 2025 14:02
Show Gist options
  • Select an option

  • Save REASY/cfa46aca4181885a99b6e0476d5176a4 to your computer and use it in GitHub Desktop.

Select an option

Save REASY/cfa46aca4181885a99b6e0476d5176a4 to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS waf_events
(
event_time DateTime64(3),
data_date Date DEFAULT toDate(event_time),
hour_key UInt32 DEFAULT toYYYYMMDD(event_time) * 100 + toHour(event_time),
bucket_s DateTime DEFAULT toStartOfSecond(event_time),
topic LowCardinality(String),
partition Int32,
offset Int64,
queue_time DateTime64(3),
app_receive_time DateTime64(3),
app_parse_time DateTime64(3),
app_enqueue_time DateTime64(3),
app_dequeue_time DateTime64(3),
id String,
server String,
ip IPv4,
request_url Nullable(String),
full_request_url Nullable(String),
referrer Nullable(String),
user_agent Nullable(String),
session_id Nullable(String),
user_id Nullable(String),
ajax_request Bool,
known_bot Bool,
known_bot_name Nullable(String),
mitigation_action Nullable(String),
traffic_type Nullable(String),
accept_language Nullable(String),
whitelabel_id Int32,
resource Nullable(String),
platform Nullable(String),
subnet String,
is_new_user_id Bool,
excluded_from_bot_detection Bool,
excluded_from_resource_capacity Bool,
) ENGINE = MergeTree
PARTITION BY hour_key
ORDER BY (bucket_s)
SETTINGS index_granularity = 8192;
CREATE TABLE IF NOT EXISTS fs_styx_userid_resource_v2
(
-- Partitioning Key
day Date,
-- Grouping Keys
bucket_s DateTime,
feature_key String,
-- Aggregate Function States
count AggregateFunction(count),
last_seen_event_time AggregateFunction(max, DateTime64(3))
) ENGINE = AggregatingMergeTree()
PARTITION BY day
ORDER BY (bucket_s, feature_key)
TTL day + INTERVAL 7 DAY DELETE;
CREATE MATERIALIZED VIEW IF NOT EXISTS fs_styx_userid_resource_v2_mv
TO fs_styx_userid_resource_v2 AS
SELECT toDate(event_time) AS day,
bucket_s,
concat(user_id, '_', resource) AS feature_key,
countState() AS count,
maxState(event_time) AS last_seen_event_time
FROM waf_events
WHERE excluded_from_bot_detection != TRUE AND coalesce (resource, 'default') != 'default' AND is_new_user_id = FALSE
GROUP BY day, bucket_s, feature_key;
CREATE TABLE IF NOT EXISTS fs_styx_userid_resource_v2_1m
(
-- Partitioning Key
day Date,
-- Grouping Keys
bucket_m DateTime,
feature_key String,
-- Aggregate Function States
count AggregateFunction(count),
last_seen_event_time AggregateFunction(max, DateTime64(3))
) ENGINE = AggregatingMergeTree()
PARTITION BY day
ORDER BY (bucket_m, feature_key)
TTL day + INTERVAL 7 DAY DELETE;
CREATE MATERIALIZED VIEW IF NOT EXISTS fs_styx_userid_resource_v2_1m_mv
TO fs_styx_userid_resource_v2_1m AS
SELECT toDate(bucket_s) AS day,
toStartOfMinute(bucket_s) AS bucket_m,
feature_key,
countMergeState(count) AS count,
maxMergeState(last_seen_event_time) AS last_seen_event_time
FROM fs_styx_userid_resource_v2
WHERE bucket_s >= toTimeZone(parseDateTime64BestEffort('2025-10-22 03:11:56', 3, 'Asia/Singapore'), 'UTC')
GROUP BY day, bucket_m, feature_key;
@REASY
Copy link
Copy Markdown
Author

REASY commented Oct 25, 2025

Bring back 64 CPU to ClickHouse and set <max_threads>24</max_threads>

[
  {
    "formatReadableSize(result_bytes)": "348.68 MiB",
    "percent_of_used_rows": 76.10965853548387,
    "NetworkSendElapsedMs": 4100.457,
    "NetworkSendBytes": 203357724,
    "hostname": "8edab12dd339",
    "type": "QueryFinish",
    "event_date": "2025-10-25",
    "event_time": "2025-10-25T14:11:23Z[UTC]",
    "event_time_microseconds": "2025-10-25T14:11:23.024151Z[UTC]",
    "query_start_time": "2025-10-25T14:11:16Z[UTC]",
    "query_start_time_microseconds": "2025-10-25T14:11:16.831848Z[UTC]",
    "query_duration_ms": 6193,
    "read_rows": 5314315,
    "read_bytes": 589887147,
    "written_rows": 0,
    "written_bytes": 0,
    "result_rows": 4044707,
    "result_bytes": 365612872,
    "memory_usage": 2116662222,
    "current_database": "default",
    "query": "\n            WITH\n                now() AS E,\n                (E - toIntervalSecond(900)) AS S,\n                toStartOfMinute(S) AS Sm,\n                toStartOfMinute(E) AS Em,\n                (Sm + INTERVAL 1 MINUTE) AS Sm_next\n            SELECT\n                feature_key,\n                countMerge(count) AS count,\n                maxMerge(last_seen_event_time) AS last_seen_event_time\n            FROM\n                (\n                    -- 1) Head partial seconds: S .. min(E, Sm_next-1s)\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2\n                    WHERE bucket_s >= S\n                      AND bucket_s < Sm_next\n                      AND bucket_s <= E\n                    GROUP BY feature_key\n\n                    UNION ALL\n\n                    -- 2) Full minutes strictly inside (S, E)\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2_1m\n                    WHERE bucket_m >= Sm_next\n                      AND bucket_m < Em\n                    GROUP BY feature_key\n\n                    UNION ALL\n\n                    -- 3) Tail partial seconds: Em .. E\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2\n                    WHERE bucket_s >= Em\n                      AND bucket_s <= E\n                    GROUP BY feature_key\n                    )\n            GROUP BY feature_key;\n            \n",
    "formatted_query": "",
    "normalized_query_hash": "<failed to load>\njava.sql.SQLException: Method: getLong(\"normalized_query_hash\") encountered an exception.\n\tat com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:74)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:320)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:175)\n\tin CHouseJdbcHelper.tryGetObject(CHouseJdbcHelper.java:156)\nCaused by: java.lang.ArithmeticException: integer overflow: 16443151356930779613 cannot be presented as long\n\tat com.clickhouse.client.api.data_formats.internal.NumberConverter.toLong(NumberConverter.java:87)\n\tat com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.readNumberValue(AbstractBinaryFormatReader.java:378)\n\tat com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.getLong(AbstractBinaryFormatReader.java:402)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:314)\n\t... 22 more\n",
    "query_kind": "Select",
    "databases": ["default"],
    "tables": ["default.fs_styx_userid_resource_v2", "default.fs_styx_userid_resource_v2_1m"],
    "columns": ["default.fs_styx_userid_resource_v2.bucket_s", "default.fs_styx_userid_resource_v2.count", "default.fs_styx_userid_resource_v2.feature_key", "default.fs_styx_userid_resource_v2.last_seen_event_time", "default.fs_styx_userid_resource_v2_1m.bucket_m", "default.fs_styx_userid_resource_v2_1m.count", "default.fs_styx_userid_resource_v2_1m.feature_key", "default.fs_styx_userid_resource_v2_1m.last_seen_event_time"],
    "partitions": ["default.fs_styx_userid_resource_v2.20251025", "default.fs_styx_userid_resource_v2_1m.20251025"],
    "projections": [],
    "views": [],
    "exception_code": 0,
    "exception": "",
    "stack_trace": "",
    "is_initial_query": 1,
    "user": "default",
    "query_id": "0f43ce98-df4e-48a4-8bce-1449f89c1df0",
    "address": "/172.18.0.3",
    "port": 45996,
    "initial_user": "default",
    "initial_query_id": "0f43ce98-df4e-48a4-8bce-1449f89c1df0",
    "initial_address": "/172.18.0.3",
    "initial_port": 45996,
    "initial_query_start_time": "2025-10-25T14:11:16Z[UTC]",
    "initial_query_start_time_microseconds": "2025-10-25T14:11:16.831848Z[UTC]",
    "interface": 2,
    "is_secure": 0,
    "os_user": "",
    "client_hostname": "",
    "client_name": "",
    "client_revision": 0,
    "client_version_major": 0,
    "client_version_minor": 0,
    "client_version_patch": 0,
    "script_query_number": 0,
    "script_line_number": 0,
    "http_method": 1,
    "http_user_agent": "clickhouse-rs/0.14.0 (lv:rust/1.89.0, os:linux)",
    "http_referer": "",
    "forwarded_for": "",
    "quota_key": "",
    "distributed_depth": 0,
    "revision": 54510,
    "log_comment": "",
    "thread_ids": [2218, 10208, 1989, 2163, 2870, 22099, 2223, 2659, 1708, 1913, 2186, 2089, 2059, 2253, 1937, 2224, 3485, 1711, 2293, 1868, 8466, 2168, 2294, 3751, 2296, 1949, 2046, 7478, 2281, 3154, 1838, 1869, 8465, 15562, 2938, 1858, 2124, 2119, 1919, 2307, 2943, 2238, 1750, 1626, 2596, 1914, 2205, 1863, 2004, 4128, 1874, 2182, 2085, 2807, 15558, 1881, 2134, 2110, 2298, 1692],
    "peak_threads_usage": 29,
    "ProfileEvents": {
      "Query": 1,
      "SelectQuery": 1,
      "InitialQuery": 1,
      "QueriesWithSubqueries": 4,
      "SelectQueriesWithSubqueries": 4,
      "SelectQueriesWithPrimaryKeyUsage": 3,
      "FileOpen": 17,
      "ReadBufferFromFileDescriptorReadBytes": 127992579,
      "ReadCompressedBytes": 121050748,
      "CompressedReadBufferBlocks": 1759,
      "CompressedReadBufferBytes": 395281031,
      "OpenedFileCacheHits": 109,
      "OpenedFileCacheMisses": 17,
      "OpenedFileCacheMicroseconds": 162,
      "IOBufferAllocs": 280,
      "IOBufferAllocBytes": 99394733,
      "ArenaAllocChunks": 2337,
      "ArenaAllocBytes": 1455620096,
      "FunctionExecute": 2784,
      "MarkCacheHits": 126,
      "QueryConditionCacheHits": 3,
      "QueryConditionCacheMisses": 19,
      "CreatedReadBufferOrdinary": 126,
      "DiskReadElapsedMicroseconds": 200971,
      "NetworkSendElapsedMicroseconds": 4100457,
      "NetworkSendBytes": 203357724,
      "GlobalThreadPoolLockWaitMicroseconds": 13546,
      "GlobalThreadPoolJobs": 66,
      "LocalThreadPoolExpansions": 65,
      "LocalThreadPoolShrinks": 61,
      "LocalThreadPoolThreadCreationMicroseconds": 57413,
      "LocalThreadPoolLockWaitMicroseconds": 8,
      "LocalThreadPoolJobs": 424,
      "AnalyzePatchRangesMicroseconds": 3,
      "SelectedParts": 11,
      "SelectedPartsTotal": 141,
      "SelectedRanges": 11,
      "SelectedMarks": 653,
      "SelectedMarksTotal": 467501,
      "SelectedRows": 5314315,
      "SelectedBytes": 589887147,
      "RowsReadByMainReader": 5314315,
      "RowsReadByPrewhereReaders": 5314315,
      "FilteringMarksWithPrimaryKeyMicroseconds": 10099,
      "WaitMarksLoadMicroseconds": 743,
      "ContextLock": 192,
      "ContextLockWaitMicroseconds": 1,
      "RWLockAcquiredReadLocks": 3,
      "PartsLockHoldMicroseconds": 43,
      "PartsLockWaitMicroseconds": 3,
      "RealTimeMicroseconds": 158779500,
      "UserTimeMicroseconds": 9000520,
      "SystemTimeMicroseconds": 2725414,
      "SoftPageFaults": 467824,
      "OSCPUWaitMicroseconds": 22098255,
      "OSCPUVirtualTimeMicroseconds": 11725246,
      "OSReadChars": 128633002,
      "OSWriteChars": 215600,
      "QueryProfilerRuns": 174,
      "ThreadPoolReaderPageCacheHit": 1019,
      "ThreadPoolReaderPageCacheHitBytes": 127992579,
      "ThreadPoolReaderPageCacheHitElapsedMicroseconds": 200971,
      "SynchronousReadWaitMicroseconds": 202216,
      "AggregationHashTablesInitializedAsTwoLevel": 27,
      "InterfaceHTTPSendBytes": 203357724,
      "ConcurrencyControlSlotsGranted": 1,
      "ConcurrencyControlSlotsAcquired": 23,
      "ConcurrencyControlSlotsAcquiredNonCompeting": 1,
      "IndexBinarySearchAlgorithm": 141
    },
    "Settings": {
      "max_threads": "24",
      "use_uncompressed_cache": "0",
      "load_balancing": "in_order",
      "log_queries": "1",
      "readonly": "2",
      "max_memory_usage": "21474836480",
      "parallel_replicas_for_cluster_engines": "0"
    },
    "used_aggregate_functions": ["count", "max", "min"],
    "used_aggregate_function_combinators": ["State", "Merge"],
    "used_database_engines": [],
    "used_data_type_families": [],
    "used_dictionaries": [],
    "used_formats": ["RowBinaryWithNamesAndTypes"],
    "used_functions": ["subtractSeconds", "now", "greaterOrEquals", "minus", "and", "toIntervalMinute", "toStartOfMinute", "plus", "toIntervalSecond", "notIn", "lessOrEquals", "less", "addMinutes"],
    "used_storages": [],
    "used_table_functions": [],
    "used_executable_user_defined_functions": [],
    "used_sql_user_defined_functions": [],
    "used_row_policies": [],
    "used_privileges": ["SELECT(feature_key, count, last_seen_event_time, bucket_m) ON default.fs_styx_userid_resource_v2_1m", "SELECT(feature_key, count, last_seen_event_time, bucket_s) ON default.fs_styx_userid_resource_v2"],
    "missing_privileges": [],
    "transaction_id": [0, 0,
      "00000000-0000-0000-0000-000000000000"
    ],
    "query_cache_usage": "None",
    "asynchronous_read_counters": {
    }
  },
  {
    "formatReadableSize(result_bytes)": "349.27 MiB",
    "percent_of_used_rows": 76.13832306467357,
    "NetworkSendElapsedMs": 4079.524,
    "NetworkSendBytes": 204576749,
    "hostname": "8edab12dd339",
    "type": "QueryFinish",
    "event_date": "2025-10-25",
    "event_time": "2025-10-25T14:14:42Z[UTC]",
    "event_time_microseconds": "2025-10-25T14:14:42.275620Z[UTC]",
    "query_start_time": "2025-10-25T14:14:36Z[UTC]",
    "query_start_time_microseconds": "2025-10-25T14:14:36.084875Z[UTC]",
    "query_duration_ms": 6192,
    "read_rows": 5346527,
    "read_bytes": 592853083,
    "written_rows": 0,
    "written_bytes": 0,
    "result_rows": 4070756,
    "result_bytes": 366238048,
    "memory_usage": 2149646422,
    "current_database": "default",
    "query": "\n            WITH\n                now() AS E,\n                (E - toIntervalSecond(900)) AS S,\n                toStartOfMinute(S) AS Sm,\n                toStartOfMinute(E) AS Em,\n                (Sm + INTERVAL 1 MINUTE) AS Sm_next\n            SELECT\n                feature_key,\n                countMerge(count) AS count,\n                maxMerge(last_seen_event_time) AS last_seen_event_time\n            FROM\n                (\n                    -- 1) Head partial seconds: S .. min(E, Sm_next-1s)\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2\n                    WHERE bucket_s >= S\n                      AND bucket_s < Sm_next\n                      AND bucket_s <= E\n                    GROUP BY feature_key\n\n                    UNION ALL\n\n                    -- 2) Full minutes strictly inside (S, E)\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2_1m\n                    WHERE bucket_m >= Sm_next\n                      AND bucket_m < Em\n                    GROUP BY feature_key\n\n                    UNION ALL\n\n                    -- 3) Tail partial seconds: Em .. E\n                    SELECT\n                        feature_key,\n                        countMergeState(count) AS count,\n                        maxMergeState(last_seen_event_time) AS last_seen_event_time\n                    FROM fs_styx_userid_resource_v2\n                    WHERE bucket_s >= Em\n                      AND bucket_s <= E\n                    GROUP BY feature_key\n                    )\n            GROUP BY feature_key;\n            \n",
    "formatted_query": "",
    "normalized_query_hash": "<failed to load>\njava.sql.SQLException: Method: getLong(\"normalized_query_hash\") encountered an exception.\n\tat com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:74)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:320)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:175)\n\tin CHouseJdbcHelper.tryGetObject(CHouseJdbcHelper.java:156)\nCaused by: java.lang.ArithmeticException: integer overflow: 16443151356930779613 cannot be presented as long\n\tat com.clickhouse.client.api.data_formats.internal.NumberConverter.toLong(NumberConverter.java:87)\n\tat com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.readNumberValue(AbstractBinaryFormatReader.java:378)\n\tat com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader.getLong(AbstractBinaryFormatReader.java:402)\n\tat com.clickhouse.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:314)\n\t... 22 more\n",
    "query_kind": "Select",
    "databases": ["default"],
    "tables": ["default.fs_styx_userid_resource_v2", "default.fs_styx_userid_resource_v2_1m"],
    "columns": ["default.fs_styx_userid_resource_v2.bucket_s", "default.fs_styx_userid_resource_v2.count", "default.fs_styx_userid_resource_v2.feature_key", "default.fs_styx_userid_resource_v2.last_seen_event_time", "default.fs_styx_userid_resource_v2_1m.bucket_m", "default.fs_styx_userid_resource_v2_1m.count", "default.fs_styx_userid_resource_v2_1m.feature_key", "default.fs_styx_userid_resource_v2_1m.last_seen_event_time"],
    "partitions": ["default.fs_styx_userid_resource_v2.20251025", "default.fs_styx_userid_resource_v2_1m.20251025"],
    "projections": [],
    "views": [],
    "exception_code": 0,
    "exception": "",
    "stack_trace": "",
    "is_initial_query": 1,
    "user": "default",
    "query_id": "d94d1dc4-dfe6-4db4-8994-68441dfb3e1e",
    "address": "/172.18.0.3",
    "port": 45996,
    "initial_user": "default",
    "initial_query_id": "d94d1dc4-dfe6-4db4-8994-68441dfb3e1e",
    "initial_address": "/172.18.0.3",
    "initial_port": 45996,
    "initial_query_start_time": "2025-10-25T14:14:36Z[UTC]",
    "initial_query_start_time_microseconds": "2025-10-25T14:14:36.084875Z[UTC]",
    "interface": 2,
    "is_secure": 0,
    "os_user": "",
    "client_hostname": "",
    "client_name": "",
    "client_revision": 0,
    "client_version_major": 0,
    "client_version_minor": 0,
    "client_version_patch": 0,
    "script_query_number": 0,
    "script_line_number": 0,
    "http_method": 1,
    "http_user_agent": "clickhouse-rs/0.14.0 (lv:rust/1.89.0, os:linux)",
    "http_referer": "",
    "forwarded_for": "",
    "quota_key": "",
    "distributed_depth": 0,
    "revision": 54510,
    "log_comment": "",
    "thread_ids": [2079, 2202, 2154, 2263, 2186, 22101, 2804, 3480, 1607, 1922, 7479, 2281, 2239, 2280, 2264, 1636, 1915, 2109, 1867, 2255, 1760, 1909, 2254, 2157, 3149, 1694, 3060, 1605, 1969, 1709, 1971, 1750, 2138, 1862, 1765, 13696, 2271, 35833, 2197, 3749, 1930, 1924, 22100, 2118, 13408, 7103, 2171, 2074, 3748, 11217, 1838, 1644, 3487, 2062, 2256, 1635, 3478, 4070, 1645, 11219, 2098, 1904, 1710, 2195, 1855, 23389, 2049, 1705, 2093, 2230, 3486, 2128, 1968, 1774, 2593, 2302, 2075, 1881, 2228, 1646, 1722, 35836, 2662, 1746, 2037, 2084, 2266, 15555, 2238, 2247, 8465],
    "peak_threads_usage": 32,
    "ProfileEvents": {
      "Query": 1,
      "SelectQuery": 1,
      "InitialQuery": 1,
      "QueriesWithSubqueries": 4,
      "SelectQueriesWithSubqueries": 4,
      "SelectQueriesWithPrimaryKeyUsage": 3,
      "FileOpen": 12,
      "ReadBufferFromFileDescriptorReadBytes": 126913575,
      "ReadCompressedBytes": 121223715,
      "CompressedReadBufferBlocks": 1749,
      "CompressedReadBufferBytes": 397484770,
      "OpenedFileCacheHits": 104,
      "OpenedFileCacheMisses": 12,
      "OpenedFileCacheMicroseconds": 140,
      "IOBufferAllocs": 260,
      "IOBufferAllocBytes": 96643435,
      "ArenaAllocChunks": 2333,
      "ArenaAllocBytes": 1484189696,
      "FunctionExecute": 2760,
      "MarkCacheHits": 116,
      "QueryConditionCacheHits": 4,
      "QueryConditionCacheMisses": 8,
      "CreatedReadBufferOrdinary": 116,
      "DiskReadElapsedMicroseconds": 203708,
      "NetworkSendElapsedMicroseconds": 4079524,
      "NetworkSendBytes": 204576749,
      "GlobalThreadPoolLockWaitMicroseconds": 152,
      "GlobalThreadPoolJobs": 94,
      "LocalThreadPoolExpansions": 93,
      "LocalThreadPoolShrinks": 83,
      "LocalThreadPoolThreadCreationMicroseconds": 9949,
      "LocalThreadPoolLockWaitMicroseconds": 705,
      "LocalThreadPoolJobs": 416,
      "AnalyzePatchRangesMicroseconds": 2,
      "SelectedParts": 6,
      "SelectedPartsTotal": 133,
      "SelectedRanges": 6,
      "SelectedMarks": 655,
      "SelectedMarksTotal": 468025,
      "SelectedRows": 5346527,
      "SelectedBytes": 592853083,
      "RowsReadByMainReader": 5340827,
      "RowsReadByPrewhereReaders": 5346527,
      "FilteringMarksWithPrimaryKeyMicroseconds": 2780,
      "WaitMarksLoadMicroseconds": 5638,
      "ContextLock": 187,
      "ContextLockWaitMicroseconds": 2,
      "RWLockAcquiredReadLocks": 3,
      "PartsLockHoldMicroseconds": 63,
      "RealTimeMicroseconds": 161292633,
      "UserTimeMicroseconds": 8830734,
      "SystemTimeMicroseconds": 2771818,
      "SoftPageFaults": 453750,
      "OSCPUWaitMicroseconds": 21462539,
      "OSCPUVirtualTimeMicroseconds": 11601927,
      "OSReadChars": 127523142,
      "OSWriteChars": 219872,
      "QueryProfilerRuns": 178,
      "ThreadPoolReaderPageCacheHit": 1009,
      "ThreadPoolReaderPageCacheHitBytes": 126913575,
      "ThreadPoolReaderPageCacheHitElapsedMicroseconds": 203708,
      "SynchronousReadWaitMicroseconds": 204825,
      "AggregationHashTablesInitializedAsTwoLevel": 28,
      "InterfaceHTTPSendBytes": 204576749,
      "ConcurrencyControlSlotsGranted": 1,
      "ConcurrencyControlSlotsAcquired": 23,
      "ConcurrencyControlSlotsAcquiredNonCompeting": 1,
      "IndexBinarySearchAlgorithm": 133
    },
    "Settings": {
      "max_threads": "24",
      "use_uncompressed_cache": "0",
      "load_balancing": "in_order",
      "log_queries": "1",
      "readonly": "2",
      "max_memory_usage": "21474836480",
      "parallel_replicas_for_cluster_engines": "0"
    },
    "used_aggregate_functions": ["count", "max", "min"],
    "used_aggregate_function_combinators": ["State", "Merge"],
    "used_database_engines": [],
    "used_data_type_families": [],
    "used_dictionaries": [],
    "used_formats": ["RowBinaryWithNamesAndTypes"],
    "used_functions": ["subtractSeconds", "now", "greaterOrEquals", "minus", "and", "toIntervalMinute", "toStartOfMinute", "plus", "toIntervalSecond", "notIn", "lessOrEquals", "less", "addMinutes"],
    "used_storages": [],
    "used_table_functions": [],
    "used_executable_user_defined_functions": [],
    "used_sql_user_defined_functions": [],
    "used_row_policies": [],
    "used_privileges": ["SELECT(feature_key, count, last_seen_event_time, bucket_m) ON default.fs_styx_userid_resource_v2_1m", "SELECT(feature_key, count, last_seen_event_time, bucket_s) ON default.fs_styx_userid_resource_v2"],
    "missing_privileges": [],
    "transaction_id": [0, 0,
      "00000000-0000-0000-0000-000000000000"
    ],
    "query_cache_usage": "None",
    "asynchronous_read_counters": {
    }
  }
]

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