Tips to get best SQL performance.
Covering all major SQL databases.
https://t.co/pPX9UrXm8p is my book.SQL-Performance-Explained.com/l/ Vienna, AustriaJoined April 2011
14 years online, still relevant and current.
Those who did the quiz 14 years ago can still benefit for their lessons at that time.
use-the-index-luke.com/3-minute-quiz
A B-tree is not a binary tree.
A B-tree does not go out of balance. A B-tree is self-balancing: it does *not* require expensive operations to keep the balance.
For this WHERE, what index to create?
WHERE subsidiary_id = 42 AND last_name LIKE '%INA%'
Is (subsidiary_id) enough or should it be (subsidiary_id, last_name)?
use-the-index-luke.com/sql/clustering…
My favorite change is that MariaDB got an improved "WHERE year(...) = ?" rewriting. use-the-index-luke.com/blog/2024-12/d…
In picture: the green check mark used to be yellow, with the "a" footnote: Unconditionally rewritten—even if only a matching function-based index exists
Improved RCSI Ghost Cleanup in SQL Server 2022
— by Paul White
As always, Paul provides deep insight into the SQL Server implementation.
sql.kiwi/2024/12/improv…
If you are not sure what collations are about, please read the entire series by Christophe Pettus:
“Gentlemen, this is a 🏈”: Glyphs, Encodings, Collations, and Locales
thebuild.com/blog/2024/10/2…
Speaking in Tongues: PostgreSQL and Character Encodings
thebuild.com/blog/2024/10/2…
Collations are a wonderful feature.
They solve problems way beyond case-insensitive search: ignoring accents and "numeric" sorting ('10' > '2') are just two more examples.
However, they do have a performance impact as shown by this micro-benchmark:
thebuild.com/blog/2024/11/2…
At about this time of the day, I run my open-to-everyone trainings.
The last training this year is "SQL Performance Explained", for which I have one spot left. It starts Dec 2nd and is delivered in seven 2-hour long in-person sessions each Mon/Wed/Fri.
winand.at/sql-training/o…
Finding for the most recent, best matching, highest ranking rows (“Top-N”) is a common problem.
The window functions ROW_NUMBER, RANK and DENSE_RANK can be used for such queries.
Not all systems optimize these queries well—PostgreSQL 15 just learned it.
use-the-index-luke.com/sql/partial-re…
In the meanwhile enjoy a discount for SQL Performance Explained if you don't have it yet: 15YrsAnniversary
Only valid when purchasing directly from me (not on Amazon, ...):
sql-performance-explained.com
(but valid for all languages — see language selection at the top).
25K Followers 306 FollowingThe Database Guy. I am helping you get better with MySQL and PostgreSQL.
⚡️ https://t.co/WwHTfJFoA5
📝 https://t.co/zJpXKSTKve
🛠️ @stackbricksapp
3K Followers 1K FollowingData Platform MVP. Formula 1 DBA.
Founder at @quantumdatis
Retired account, please find me with same handle where the sky is blue
11K Followers 3K FollowingIndustry’s leading Data Platform conference - over 200 sessions across 4 days covering a range of data technologies📊 Winner of UK Conference of the Year 2020🏆
4K Followers 895 FollowingBI pro and tattooed #sqlserver geek. Data warehousing. Former Data Platform MVP. Punk rock fan. Married & father of 2. He/him @[email protected].
9K Followers 6K FollowingData strategist: DBA, Db2, database, data, DBMS, mainframes, IBM Z | IBM Champion for Data & AI | IBM Gold Consultant | Db2 and mainframe veteran
118 Followers 477 FollowingUm homem que busca temer a Deus e a preparação para servi-lO. Nas horas vagas: servidor estadual atuando no Escritório de Gestão de Projetos de Santa Catarina
0 Followers 41 FollowingFreelance software developer - C#, asp net core, Blazor, WinUI, SQL Server, Azure.
Available for bespoke work and modernisation tasks.
#WinUI anybody?
9K Followers 258 FollowingSQL Renaissance Ambassador. Author, Trainer, Coach. PhD in Common Sense. Creator of https://t.co/6oKhq87B43 and https://t.co/RrIy2AY7Tl.