This engine allows integrating ClickHouse with Redis. For Redis takes kv model, we strongly recommend you only query it in a point way, such asDocumentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
where k=xx or where k in (xx, xx).
Creating a table
host:port— Redis server address, you can ignore port and default Redis port 6379 will be used.db_index— Redis db index range from 0 to 15, default is 0.password— User password, default is blank string.pool_size— Redis max connection pool size, default is 16.primary_key_name- any column name in the column list.
Serialization
PRIMARY KEY supports only one column. The primary key will be serialized in binary as a Redis key.
Columns other than the primary key will be serialized in binary as Redis value in corresponding order.host and port should be specified separately. This approach is recommended for production environment. At this moment, all parameters passed using named collections to redis are required.
FilteringQueries with
key equals or in filtering will be optimized to multi keys lookup from Redis. If queries without filtering key full table scan will happen which is a heavy operation.Usage example
Create a table in ClickHouse usingRedis engine with plain arguments:
Truncate support SYNC mode.
Limitations
Redis engine also supports scanning queries, such aswhere k > xx, but it has some limitations:
- Scanning query may produce some duplicated keys in a very rare case when it is rehashing. See details in Redis Scan.
- During the scanning, keys could be created and deleted, so the resulting dataset can not represent a valid point in time.