Re:Postgres 11 – A First Look
by tfehring on Sunday September 23, 2018 @12:47AM
(#18049453)
Extension or not, that's a really useful shortcut. Coming from SQL Server, the best option I know of requires a CTE or subquery:
This does give a performant plan in SQL Server with an index on (conversation_id, timestamp), for what it's worth. I imagine the same is true for this syntax in PostgreSQL. But SELECT DISTINCT sometimes does strange things to execution plans in general, and I wouldn't be surprised if that extends to SELECT DISTINCT ON.
[ Parent
| on HN ]
There are no comments on this comment yet.