April 3, 2024, 2:33 p.m. | Mircea Cadariu

DEV Community dev.to

In this post I'll show you several approaches you can use if you need to solve tasks along the lines of "retrieve the earliest/oldest/last etc row per group" from your database. I rank them by how performant I found them to be on a made-up dataset I made for this purpose.


I explain what determines the different timings with the help of visualisations showing how the database processes the query internally. As you will see, we will go from hundreds …

database dataset etc found per postgresql show solve tasks them

Senior Machine Learning Engineer

@ GPTZero | Toronto, Canada

ML/AI Engineer / NLP Expert - Custom LLM Development (x/f/m)

@ HelloBetter | Remote

Doctoral Researcher (m/f/div) in Automated Processing of Bioimages

@ Leibniz Institute for Natural Product Research and Infection Biology (Leibniz-HKI) | Jena

Seeking Developers and Engineers for AI T-Shirt Generator Project

@ Chevon Hicks | Remote

Senior Applied Data Scientist

@ dunnhumby | London

Principal Data Architect - Azure & Big Data

@ MGM Resorts International | Home Office - US, NV