Back to Langfuse

Use Native Format for Best Insert Performance

.agents/skills/clickhouse-best-practices/rules/insert-format-native.md

3.172.1723 B
Original Source

Use Native Format for Best Insert Performance

Impact: MEDIUM

Data format affects insert performance. Native format is column-oriented with minimal parsing overhead.

Performance Ranking (fastest to slowest):

FormatNotes
NativeMost efficient. Column-oriented, minimal parsing. Recommended.
RowBinaryEfficient row-based alternative
JSONEachRowEasier to use but expensive to parse

Example:

python
# Use Native format for best performance
client.execute("INSERT INTO events VALUES", data, settings={'input_format': 'Native'})

Reference: Selecting an Insert Strategy