
SQL editor, scheduler, and pipelines in one native Mac app. Daily notes for people who write queries.
Joined October 2026
- Tweets818
- Following172
- Followers50
- Likes1K
QueryFlow retweeted
Amazon Redshift extension for DuckDB brings warehouse scale to local SQL
Amazon Redshift now offers the Redshift extension for DuckDB, an open source extension that lets you run Amazon Redshift SQL from a local DuckDB session. Query results come back as DuckDB relations, so y...
QueryFlow retweeted
During a Postgres migration the disk can fill up with WAL, the log of every change. A replication slot keeps that log until the new database reads it, and during the hours long initial copy it reads nothing, so cleanup stops. Raise max_slot_wal_keep_size before you start.
QueryFlow retweeted
A startup kept BigQuery in prod and pointed dbt at DuckDB for CI. Result: 639 s of integration tests per merge became 46 s. The one trap is timestamps. Set TZ=UTC or DuckDB's local-zone default will disagree with BigQuery. Easy pattern to copy.
duckdb.org/2026/11/24/sprout…
QueryFlow retweeted
Supplier CSVs have the same headers in a different order? DuckDB can align them by name:
SELECT * FROM read_csv('quotes/*.csv', header=true, union_by_name=true);
Standardize the headers first. This won't tell you whether price and unit_price mean the same thing, or reconcile USD with EUR. Name-based alignment also uses more memory.
Docs reviewed; not tested.
github.com/duckdb/duckdb
#GitHub #DataTools #InternationalTrade
QueryFlow retweeted
Cloud ops metadata as Iceberg tables means "which buckets grew last month?" becomes a SQL query instead of console clicks.
The real win is joins across services, like AWS's own example: Glue tables no Athena query has read in 90 days. Databricks system tables already do this for the lakehouse, cost data included. teapaw.org/awswhatsnew/status/212…
QueryFlow retweeted
Monday brings #AI
Before trusting AI-written ad revenue SQL, test two impressions worth 1¢ each, where one matches two tracking events. The right total is 2¢. A plain SUM after the join gives 3¢, and SUM(DISTINCT revenue) gives 1¢.
QueryFlow retweeted
Postgres tip: if CREATE INDEX CONCURRENTLY fails, it leaves an INVALID index behind. Queries ignore it, but every write still pays to keep it updated. A retry with IF NOT EXISTS just sees the name and skips. Drop it and run it again.
QueryFlow retweeted
Asked Postgres for 10 failed rows ordered by ID and it scanned 10,000,000 rows (1,461 ms).
Why: failures clump at the tail, so walking the PK index discards millions of healthy rows first. A Bitmap Heap Scan drops it to 9.6 ms.
encountered Postgres' query planner again and wrote about it.
blog.mchl.xyz/post/expressio…
QueryFlow retweeted
Top 10 PostgreSQL mistakes that show up in prod:
1) SELECT * on hot paths. Wider rows, more IO, harder index-only scans, slower upgrades when columns grow.
2) No indexes for real queries. Filtering on user_id + status but only indexing user_id, then wondering why p95 jumps at 10M rows.
3) Adding indexes blindly. Every extra index slows writes, vacuum, and increases bloat. Measure before and after.
4) Missing composite index order. (a,b) helps a=… AND b=… and a=…, not b=… alone.
5) OFFSET pagination at scale. OFFSET 100000 still scans 100000. Use keyset pagination (WHERE id > last_id ORDER BY id LIMIT 50).
6) Long transactions. Autovacuum can’t clean dead tuples, replicas lag, and locks stick around longer than you think.
7) Ignoring VACUUM/autovacuum tuning. Default settings + write-heavy tables = bloat and surprise slowdowns weeks later.
8) No connection pooling. 500 pods each opening 20 conns turns into 10k backends, context switching, and memory pressure. Use pgbouncer.
9) Weak timeouts + retries. No statement_timeout, retries without jitter, and you amplify load during incidents.
10) No EXPLAIN (ANALYZE, BUFFERS) + poor observability. You ship a query, it regresses, and you have no slow query logs or pg_stat_statements to prove where the time went.
[generated using my AI agent, hope you learnt something]
QueryFlow retweeted
Hit Save, read from a replica, still see the old value. Classic.
#PostgreSQL 19 adds WAIT FOR LSN: a session on a read replica waits until the replica has replayed up to a given WAL position, then runs the query.
So the replica catches up to that write before you read.
MySQL InnoDB compression is still unstable. A lot of systems used table compression in the past, but later the official maintainers wanted to push page compression. However, because it relies too heavily on the file system, page compression never really took off. It's such a shame. dev.mysql.com/blog-archive/i…
QueryFlow retweeted
A gateway webhook and the customer's return to the order received page can both complete one WooCommerce order. Each holds an unpaid copy, so the order emails go out twice. We now take a MySQL GET_LOCK per order and re-read it first. How do you guard yours?
QueryFlow retweeted
Zero to Hundred had Stripe calls running inside Postgres transactions
Each one held a connection from a 20 connection pool while Stripe took its time
CI now fails on any new one
QueryFlow retweeted
When importing data in #Excel or #PowerBI via #PowerQuery, it is a good idea to set the column data types. But for wide tables is that this can take a lot of time as you have to wait for Power Query to catch up. 🙈 Here's how to quickly set ALL data types: youtube.com/watch?v=KGvfqm1n…
QueryFlow retweeted
Check out my latest article: PostgreSQL benchmarking: results, scripts and a small fire linkedin.com/pulse/postgresq… przez @LinkedIn
QueryFlow retweeted
GitHub moved 130 of its busiest database tables to new machines without holding off writes for more than only a few tens of milliseconds
For more than ten years most of GitHub sat on one main MySQL cluster. Users, repos, issues, PRs, all of it. An incident there hit everything at once, and the only way to scale was buying bigger machines
The move was kinda boring by the time it happened. The app was already treating those tables like a separate database long before anything moved
First they grouped tables that get joined and written together. Gists live with gist comments and starred gists, that kind of thing
Then they added checks that fail any query touching tables from two different groups, plus a sampled one in production that flags transactions crossing groups.
When a feature really needed both sides in one transaction, they moved that data into the same group so it stays on one machine. A group with zero crossings is safe to move
I love how small the actual cutover is. The new cluster just copies from the old one like any replica. Then a script makes the old primary read only, waits for the last change to land, stops copying, points the app at the new cluster and turns writes back on. Done at the quietest hour, it caused a handful of failed writes only
In 2019 that one cluster was serving 950K queries a second. By 2021 the same tables spread across several clusters were serving 1.2M, and the average load per machine had halved
github.blog/engineering/infr…






















