Performance considerationsΒΆ

Follow these tips to use CrateDB optimally for maximum performance.

Optimization

Description

Documentation

Leverage indexes

Important for frequently grouped or filtered fields.
Fields are indexed by default.

Query Optimization 101

Avoid SELECT *

Select only the fields you need.

Query Optimization 101

Use targeted filters

Narrow your search using WHERE clauses.
Use time filters especially on time series or partitioned tables.

WHERE clause
Comparison operators

Pre-aggregate

Maintain rollup tables for common queries; use views as convenient wrappers (views are virtual, not precomputed).

Use DATE_BIN or DATE_TRUNC

Apply time-based bucketing on time series data to reduce data volume.

DATE_BIN()
DATE_TRUNC()
Optimizing storage for historic time series data
Resampling time series data with DATE_BIN

Profile queries

Use EXPLAIN and ANALYZE to inspect performance.

EXPLAIN
ANALYZE

Sizing & sharding

Choose partitioning and shard size wisely (e.g., daily partitions for time-based data).

Sharding and partitioning 101
Sharding recommendations

Important

For in-depth details about performance aspects, please head over to the Performance guides.