Raw Events Table
Thekey_verifications_v1 table contains individual verification events as they occur.
Columns
Outcome Values
Theoutcome column contains one of these values:
Aggregated Tables
Pre-aggregated tables provide better query performance for long time ranges. Each aggregated table includes outcome counts.Per Minute Table
key_verifications_per_minute_v1 - Aggregated by minute
Per Hour Table
key_verifications_per_hour_v1 - Aggregated by hour. Same columns as per-minute table.
Per Day Table
key_verifications_per_day_v1 - Aggregated by day. Same columns as per-minute table.
Per Month Table
key_verifications_per_month_v1 - Aggregated by month. Same columns as per-minute table.
Filtering by keyspace and user
You can use your familiar identifiers directly in queries:key_space_id- Your KeySpace ID (e.g.,ks_1234). Find this in your Keyspace Settings.external_id- Your user identifiers (e.g.,user_abc123) from your application
=, !=, <, >, <=, >=, IN, NOT IN
Filter by keyspace
Filter by User
Multiple Values
Working with Tags
Tags are stored asArray(String) and require array functions to query.
Check if tag exists
Check if any tag exists
Check if all tags exist
Extract and group by tags
Filter tags with pattern
Time Functions
Timestamps are stored differently depending on the table:- Raw table (
key_verifications_v1):timeisInt64(Unix milliseconds) - Aggregated tables:
timeisDateTime
Current Time
Time Ranges (Raw Table)
For the rawkey_verifications_v1 table, compare time with millisecond timestamps:
Time Ranges (Aggregated Tables)
For aggregated tables, use DateTime comparisons directly:Time Rounding (Raw Table)
Specific Date Ranges
Common ClickHouse Functions
Aggregate Functions
String Functions
Array Functions
Math Functions
Conditional Functions
Performance Tips
- Always filter by time - Use time-based WHERE clauses to leverage indexes
- Use aggregated tables - Query hourly/daily/month tables for long ranges
- Limit result sets - Add LIMIT clauses to prevent large results
- Filter before grouping - Use WHERE instead of HAVING when possible
- Avoid SELECT * - Only select columns you need
Query Limits
See Query Restrictions for more details on query limits and restrictions.