- watched the football down the pub. technically the pitch is grass. counts
- Central Park, a book, a bench and no notifications for four hours. Book number 31 this year. Proud of you for taking the weekend, Aoife. The job hunt is a marathon, not a sprint.
Aoife Brennan
laid off from big tech in march after 6 years. data engineer, python, spark, airflow. dublin. open to work, open to cake 🇮🇪
- Dublin, Ireland
- English · Irish
- Joined Sep 2026
- Last posted Sep 24, 2026
Tags
Show all 7 tagsShow fewer
- Posts
- 2
- Followers
- 11
- Following
- 26
- Reputation
- 80
Posts
Everything this author has published.
latest row per customer without a correlated subquery that takes 40 minutes?
doing a take-home for a data engineering role (job hunt day 187, grand, all grand). table is basically: customer_events ( id bigint primary key, customer_id bigint, event_type text, payload jsonb, created_at timestamptz ) about 120M rows in their description, i've a 5M sample locally. they want the latest event per customer. my first go: SELECT e.* FROM customer_events e WHERE e.created_at = ( SELECT MAX(created_at)…
Accepted answer
ok this one I do every week lah. three ways: 1. postgres only, shortest: SELECT DISTINCT ON (customer_id) id, customer_id, event_type, payload, created_at FROM customer_events ORDER BY customer_id, created_at DESC, id DESC; DISTINCT ON keeps the first row per customer_id according to the ORDER BY. id DESC breaks the tie when created_at is same. 2. portable, works in SQL Server, Oracle, MySQL 8, Snowflake etc: SELECT id, customer_id, event_type, payload, created_at FROM ( SELECT e.*, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY created_at DESC, id DESC) AS rn FROM customer_events e ) t WHERE rn = 1; ROW_NUMBER not RANK, because RANK gives 2 rows when tie. confirm they will ask this in the follow-up. 3. when there are few customers and very many events each, LATERAL with LIMIT 1 can be fastest, it jumps into the index once per customer: SELECT c.id, last.* FROM customers c CROSS JOIN LATERAL ( SELECT e.id, e.event_type, e.payload, e.created_at FROM customer_events e WHERE e.customer_id = c.id ORDER BY e.created_at DESC, e.id DESC LIMIT 1 ) last; for all three the index is: CREATE INDEX ON customer_events (customer_id, created_at DESC, id DESC); and since we are in select-star-anonymous: list the columns in your submission, the reviewer will notice 😄- not my area but sent you another lead aoife, data eng contract in Leeds, remote mostly. they're on Postgres so you're sorted after this
Best answers
Answer people found useful
useEffect fetch running twice in my take-home test?? is my code broken
jade if you get round 3 before me i'll be raging (i'm delighted for you)
Answer people found useful
Pandera, Great Expectations or plain asserts for data validation in a small team?
We went with GX at my last job, team of 4, and regretted it. Too much config for what we needed. pandera plus dbt tests is the sweet spot for small teams imo.
Links
Where else to find this person.
Badges earned
Strongest tier first, then the most recently earned.
Settling In
BronzeA month since you joined.
Earned Oct 19, 2026
Getting Started
BronzeReached 25 reputation points.
Earned Oct 7, 2026
First Readers
BronzeYour posts have been read a hundred times.
Earned Sep 26, 2026
Worth Keeping
BronzeSomebody saved one of your posts to read again.
Earned Sep 22, 2026
Quotable
BronzeYour comments have earned ten likes.
Earned Sep 18, 2026
First Applause
BronzeSomebody liked something you wrote.
Earned Sep 16, 2026
Someone’s Listening
BronzeSomeone followed you for the first time.
Earned Sep 16, 2026
Good Company
BronzeFollowing twenty people. A feed worth opening.
Earned Sep 15, 2026
Finding People
BronzeFollowing five people. Enough for a feed with something in it.
Earned Sep 14, 2026
Explorer
BronzeJoined five topics and settled into the community.
Earned Sep 12, 2026
Show and Tell
BronzePosted your first image or GIF.
Earned Sep 11, 2026
Curious
BronzeAsked your first question. Nobody starts out knowing.
Earned Sep 11, 2026
Said Hello
BronzeLeft your first comment on somebody else’s post.
Earned Sep 11, 2026
First Post
BronzePublished your first post on Dynamo Geeks.
Earned Sep 10, 2026