Steven02/02/2023, 9:55 AM
Bolek Ziobrowski02/02/2023, 10:15 AM
Steven02/02/2023, 10:16 AM
Bolek Ziobrowski02/02/2023, 10:20 AM
but it might be more performant to alter your query not to produce duplicates .
select ts, last(field1), last(field), ... from ( your_query ) group by ts
Steven02/02/2023, 10:22 AM
Productboard02/02/2023, 10:44 AM
Bolek Ziobrowski02/02/2023, 10:46 AM
Matt02/02/2023, 6:19 PM
example. • The results are identical. • The performance is identical for this very small query (≈42ms). • But the explain plan is distinctly different, and I suspect it will be generally better.
select cab_type, vendor_id, pickup_datetime, trip_distance from trips where pickup_datetime between '2009-01-01T00:02:56.000000Z' and '2009-01-01T00:03:00.000000Z' latest on pickup_datetime PARTITION BY cab_type, vendor_id;