VERSION 1
NODE group_by_keyId
SQL >

    SELECT
        countState() AS totalUsage,
        keyId
    FROM key_verifications
    GROUP BY keyId

TYPE materialized
DATASOURCE mv_key_total_usage
ENGINE "AggregatingMergeTree"
ENGINE_SORTING_KEY "keyId"
