piby
04/30/2026, 9:16 AMWHERE my_timestamp_col > '2025-11-02T00:00:00+01:00‘
This syntax works but it takes a very long time. I am assuming either Pinot is implicitly casting my_timestamp_col to string and doing string comparison or indexes are getting ignored due to type mismatch.
When we convert our datetime string to TIMESTAMP type exactly, our query performance improves significantly.
However, I’m curious which of these three approaches is recommended for filtering TIMESTAMP columns, especially regarding the Multi-Stage Engine:
Option A (ANSI SQL CAST):
WHERE my_timestamp_col > CAST('2025-11-02T00:00:00+01:00' AS TIMESTAMP)
Option B (Explicit Functions):
WHERE my_timestamp_col > toTimestamp(fromIso8601('2025-11-02T00:00:00+01:00'))
Option C (Standard Literal - This does not support timezones - UTC only ):
WHERE my_timestamp_col > TIMESTAMP '2025-11-02 00:00'
Our specific questions:
Performance: Is any one of these more "index-friendly" than the others?
Timezones: Does CAST (Option A) reliably handle the +01:00 offset, or should we stick to fromIso8601 (Option B) for anything non-UTC?
Engine Preference: With the move toward the Multi-Stage Engine, is there a preferred syntax for long-term compatibility? (we only use multi stage engine)
Would love to hear your thoughts on the "cleanest" way to handle this in production. Thanks!Xiang Fu
piby
04/30/2026, 10:29 AM