ClickHouse is not support Timestamp?

Created on 25 Feb 2017  Â·  6Comments  Â·  Source: ClickHouse/ClickHouse

like 2017-02-05 15:20:22:222

question

All 6 comments

ClickHouse does not support a data type for time with more than one second resolution.

Suggested solution is to store time with resolution up to seconds in one column of type DateTime and to store milliseconds/microseconds in separate column of type UInt16 or UInt32.

This is reasonable, because fractional part of time is usually pseudorandom and compresses much worse, so when you just need to read time up to seconds, it would be read much faster if it is stored separate of fractional part.

Another soultion is to store unix timestamp multiplied by 1000 or 1000000 with added number of milliseconds/microseconds in field of type UInt64. But in that case, it is more difficult to implement date and time calculations than with DateTime data type.

oh ,This is bad info.
ClickHouse used LZ4 compresses ?
If i used Timestamp need tow column?

Yes, ClickHouse uses LZ4 compression algorithm for compressing column data. Optionally you can configure it so that ZSTD algorithm is chosen (see comments in config.xml)

@ztlpn Thanks

when support datetime with millisecond?

Was this page helpful?
0 / 5 - 0 ratings