boringSQL

@boringsql
20 Followers
22 Following
27 Posts
Embrace simplicity and reliability with boringSQL. Share passion for things that just works - SQL and PostgreSQL. My name is Radim and i will make your database life boring :)
Websitehttps://boringsql.com

Everyone says store money as numeric, not float. Fewer people can say what breaks if you don’t.

Your float SUM changes every run. Same rows, nothing touched, three different totals. That’s floats plus parallel aggregation.

Turn parallelism off and it’s stable. Still wrong.

https://boringsql.com/posts/same-rows-different-sum/

Same rows, different SUM

Same query, same rows, different SUM totals in PostgreSQL. The culprit is parallel aggregation over double precision floats, not a bug. Here is the mechanism and the fix.

boringSQL | Supercharge your SQL & PostgreSQL powers

A single NULL turns NOT IN into a query that silently returns zero rows, and the planner couldn't optimize around it for as long as anyone can remember, until a PostgreSQL 19 patch fixed that.

https://boringsql.com/posts/not-in-null/

The NULL in your NOT IN

A single NULL turns NOT IN into a query that silently returns zero rows, and the planner couldn't optimize around it for 25 years, until a PostgreSQL 19 patch.

boringSQL | Supercharge your SQL & PostgreSQL powers
Postgres chat with a view - amazing warmup for @pgdata2026 - let’s go #postgres Chicago

You trust #postgresql pg_stat_statements bit too much. That might be the problem. It's quietly bending what it reports, and none of it is a bug.

Part 1 - everything it tells you https://boringsql.com/posts/pg-stat-statements/

Part 2 - everything it can't https://boringsql.com/posts/pg-stat-statements-part-2/

pg_stat_statements: everything it tells you

What pg_stat_statements records and what it quietly drops: the queryid jumble that splits one query into many rows, the frozen first-seen query text, and averages that hide your p99.

boringSQL | Supercharge your SQL & PostgreSQL powers
Strong views on PostgreSQL VIEWs

Views are PostgreSQL's cleanest abstraction and its most rigid. Rewrite rules, attribute numbers, and the dependency catalog turn column changes into teardowns.

boringSQL | Supercharge your SQL & PostgreSQL powers

🐘 PostgreSQL Conference Poland - PGConf.PL 2026 is happening!

Join us on 24 November 2026 in Gdańsk, Poland, for the first edition of a new PostgreSQL community conference.

CFP, registration, and sponsorship opportunities will open soon.

More details: https://pgconf.pl/

Save the date - see you in Gdańsk!

#PostgreSQL #Postgres #PGConfPL #OpenSource #Conference #Poland #Gdansk

boringSQL Live session #2 is now scheduled and we will go deep into and visually understand #postgresql storage internals.

Do you want to understand what bloat looks like? What VACUUM is really doing under the hood? And why it won't always save your indexes? Come find out.

🗓️ Wed, June 10 - 15:30 UTC (timezone specific time on the event page)

https://luma.com/g5bwwqfj

boringSQL Live #2 · Luma

Second boringSQL Live session. 👋 Agenda for the session is around PostgreSQL Storage Internals. It extends the conference talk I've been giving in last 6…

I'm honored for the opportunity to speak at @pgdata2026

🗓️ Thu, June 4, 1:40pm - Room 1 - Visualizing PostgreSQL Storage Internals

And on top of speaking, I now have a series of very interesting talks lined up that I want to attend. Plus I can't wait for all the hallway chats. That's the place where ideas are born. When you see my boringSQL t-shirt, come say hi 🙏

I'm getting older and wiser (pun intended), that means I have already submitted proposals for @pgconfeu yesterday, not 1 hour before the deadline 🤣 as I would normally do
In hind-sight it actually makes perfect sense. ALL data. Reading relevant commits instead of sleep is good exercise in being bit more humble next time.