SQL Performance Tips (@SQLPerfTips) header
SQL Performance Tips (@SQLPerfTips) profile picture

Tips to get best SQL performance. Covering all major SQL databases. https://nitter.gq/t.co/pPX9UrXm8p is my book.

Vienna, Austria
Joined April 2011
Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)Photo by SQL Performance Tips (@SQLPerfTips)
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-min…
2
14
1,496
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.
1
10
1,850
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/20…
2
6
22
2,568
As sort-based indexes (such as B-Tree) also use collations to establish their row order, the speed of the collation affects the index build time, but not so much the search time as the number of comparisons for a search is very limited.
1
113
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/c…
3
1
16
3,014
There is currently some fuzz about the performance of subqueries vs with clause. Here is my take on it: modern-sql.com/feature/with/…
7
1
37
5,432
What every developer should know about SQL performance - Index/Query (mis)match - The first power of indexing: finding data quickly - The second power of indexing: clustering data - The third power of indexing: sorting data
2
9
53
7,026
The Oracle DB maintains some information either on block or on row level ([NO]ROWDEPENDENCIES). dbaora.com/ora_rowscn-norowd… The default (NOROWDEPENDENCIES) may cause ORA-08177: can't serialize access for this transaction even if there is no problem on row level.
1
1
5
4,220
When is a secondary index-only query not index-only for InnoDB and Postgres? In PostgreSQL it is well-know that even Index-Only Scan can have "Heap Fetches". For InnoDB it is hardly known and not visible at all. smalldatum.blogspot.com/2022…
7
1
26
5,336
Building a faster hash table for high performance SQL joins — by @AndreyPechkurov of @QuestDb questdb.io/blog/building-fas…
10
64
9,579
Why Batch Mode Sort Spills Are So Slow [in SQL Server] sql.kiwi/2023/11/batch-sort-…
8
2,635