In summary, PostgreSQL allows the use of `DISTINCT ON` to select the first row of each group in a query, which is useful for retrieving specific data such as the latest measure for each metric in a timeseries database or the last contract with each supplier. This approach can be more efficient than using window functions or recursive common table expressions, especially when combined with YugabyteDB's storage layer optimizations. However, it requires careful consideration of index definitions and may not be standard SQL.