
Unlock this content
Enter your email to unlock this content for free
Date and Time
Choose the lowest DateTime precision needed (DateTime for seconds, DateTime64(3) for milliseconds) to avoid massive storage overhead. Do not default to nanoseconds (DateTime64(9)). Store timestamps in UTC and convert at query time. Use Date for rollups, DateTime for events.
Choosing Date Types
Use Date for: Day-level granularity, daily rollups, aggregations, when storage efficiency is critical.
Use DateTime for: Events with timestamps, time-of-day information, second-level precision (most common for event data).
Use DateTime64(3) for: Events requiring millisecond precision (web analytics, API monitoring).
Use DateTime64(9) for: Only if you truly need nanosecond precision (rare specialized use cases).