Tomás Ferreira
@tomasf
Member · Member since Oct 2017
Database person. If your query is slow, it is probably the index.
0 followers · 0 following
Badges and trust level are earned across the whole community.
- Topics created
- 2
- Posts created
- 7
- Likes given
- 22
- Likes received
- 67
- Days visited
- 0
- Solutions
- 3
Days visited count across the whole community, not just this forum.
Most active topics
- PostgreSQL: query is slow even though the column is indexed
4 replies · 11 votes
- SQL: get the latest row per group
2 replies · 12 votes
Most liked posts
- Git: undo the most recent local commits
And if you only need to fix the message or add a forgotten file: git commit --amend.
13 likes
- Docker container exits immediately with code 0
The trailing & backgrounds the process. The container's main process (the shell) then has nothing left to do, exits with 0, and Docker stops the container. Use
12 likes
- SQL: get the latest row per group
For each customer_id I need the most recent order from orders(id, customer_id, created_at, total).
12 likes
- PostgreSQL: query is slow even though the column is indexed
This query takes ~4 s on a 30M-row table even though created_at has a B-tree index: SELECT * FROM events WHERE date(created_at) = '2026-10-01'; EXPLAIN shows a
11 likes
- Spark: how to avoid a shuffle when joining a small table?
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
9 likes
Top categories
Top tags
- #postgresql 2
- #groupwise-max 1
- #indexing 1
- #query-optimization 1
- #sql 1
Recent badges
- Vim: how do I exit without saving?
I opened a file in vim by accident. How do I quit and discard changes?
Likes given · 10/12/2026
- SQL: get the latest row per group
Liked by Hollis Grant
For each customer_id I need the most recent order from orders(id, customer_id, created_at, total).
Likes received · 10/12/2026
- PostgreSQL: query is slow even though the column is indexed
Liked by Mateus Brandão
This query takes ~4 s on a 30M-row table even though created_at has a B-tree index: SELECT * FROM events WHERE date(created_at) = '2026-10-01'; EXPLAIN shows a
Likes received · 10/12/2026
- Git: undo the most recent local commits
I committed the wrong files and have not pushed yet. How do I undo the last commit but keep my changes?
Likes given · 10/12/2026
- C#: async void vs async Task
Only for event handlers. Exceptions from async void cannot be caught by the caller and crash the process; use async Task everywhere else.
Likes given · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Keiko Arai
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Amara Nwosu
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Lin Mei
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Ben Achterberg
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by user8841203
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Priya Raghunathan
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Svetlana Orlova
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Hollis Grant
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Spark: how to avoid a shuffle when joining a small table?
Liked by Dmitri Vasko
Broadcast the small side: from pyspark.sql.functions import broadcast facts.join(broadcast(lookup), "country_code") Spark also does this automatically below spa
Likes received · 10/12/2026
- Floating point: why is 0.1 + 0.2 != 0.3?
No — 0.1 and 0.2 have no exact binary representation, so the sum is 0.30000000000000004. Compare with a tolerance: Math.abs(a - b) < Number.EPSILON and use inte
Likes given · 10/12/2026
- Floating point: why is 0.1 + 0.2 != 0.3?
0.1 + 0.2 === 0.3 is false in JavaScript. Is the language broken?
Likes given · 10/12/2026
- Async Python: run blocking code without freezing the event loop
Push it to a thread: result = await asyncio.to_thread(blocking_fn, arg) For CPU-heavy work use a process pool with loop.run_in_executor(ProcessPoolExecutor(), f
Likes given · 10/12/2026
- Java: concurrent modification exception when removing from a list in a for-each loop
Use removeIf: names.removeIf(String::isBlank); or an explicit Iterator and it.remove().
Likes given · 10/12/2026
- Kubernetes pod stuck in CrashLoopBackOff, no logs
Liked by Priya Raghunathan
Look at the previous container and the events: kubectl logs mypod --previous kubectl describe pod mypod # check Last State, Exit Code, Events Exit code 137 is
Likes received · 10/12/2026