I'm attempting to benchmark clickhouse against postgres for API use.
The dataset is ~40M records
SELECT
name,
web_url,
image_url,
visitor_id,
web_id
FROM analytics WHERE event_id = (
SELECT uuid
FROM interaction_logs
WHERE path_id = '12bc4ca0ed14ds3a8ab5d2061c2e551a18a936f14d' )
ORDER BY visitor_id ASC LIMIT 0, 10
However, this query takes approx ~2S to run. This is extremely bad for anything production under any user-load. Is this normal? If not what can i do to improve it?
The server is a AWS c5a.8xlarge instance (32 vCPU/64GB RAM)
I've attempted to set the max_threads and max memory per query, both did not impact performance.
The actual table creation query:
CREATE TABLE analytics(
`uuid` UUID,
...
)
ENGINE=MergeTree()
ORDER BY uuid;