Interesting problem of a huge query requesting 2TB of memory "by accident"

https://mydbanotebook.org/posts/work_mem-its-a-trap/

#postgresql #dba #queryPerformance #memory

work_mem: it's a trap! | My DBA Notebook

My friend Henrietta Dombrovskaya pinged me on Telegram. Her production cluster had just been killed by the OOM killer after eating 2 TB of RAM. work_mem was set to 2 MB. Something didn’t add up. Hetty, like me, likes playing with monster hardware. 2 TB of RAM is not unusual in her world. But losing the whole cluster to a single query during peak operations is a very different kind of problem from a 3am outage.

It seems #Microsoft deliberately cripples the abilities of their #Postgres offering, especially when it comes to parallel query. I can't explain otherwise why their Azure hosting is consistently (substantially) slower than our low-end VM with identical data and configuration.

#sql #queryPerformance

#throwback Think EXPLAIN tells the whole story? 👀 Ants Aasma reveals the hidden performance gremlins PostgreSQL plans don’t show—TOAST lookups, visibility checks, hint bits, and more. Learn how to spot what’s slowing you down.

▶️ Watch now! https://www.youtube.com/watch?v=y07-VLh7Sxc&list=PL_m-TUcr7ZvnSBmPoxZvcB1lfy7C9eced&index=12

#PostgreSQL #PGDay #PPDD #QueryPerformance #ExplainPlan

👨‍💻🎩 "Evan Schwartz just discovered that #SQLite indexes exist and now thinks he's a #database wizard. 🎉 Despite his 'subtle' revelation, he managed to improve query performance by 35%, proving that even a broken clock is right twice a day." 🤦‍♂️
https://emschwartz.me/subtleties-of-sqlite-indexes/ #DatabaseWizard #QueryPerformance #TechHumor #HackerNews #ngated
Subtleties of SQLite Indexes

Understanding query planner quirks yielded a ~35% speedup.

Evan Schwartz
Finding the First Match of Names in a Large Database
Optimize DB2 LUW queries for speed! Find the first match of a name in a large table using ROW_NUMBER() window function. Avoid fetching all matches. #DB2 #SQL #ROW_NUMBER #WindowFunctions #DatabaseOptimization #QueryPerformance
https://tech-champion.com/programming/finding-the-first-match-of-names-in-a-large-database/
...
Finding the First Match of Names in a Large Database
Optimize DB2 LUW queries for speed! Find the first match of a name in a large table using ROW_NUMBER() window function. Avoid fetching all matches. #DB2 #SQL #ROW_NUMBER #WindowFunctions #DatabaseOptimization #QueryPerformance
https://tech-champion.com/programming/finding-the-first-match-of-names-in-a-large-database/
...
Database Query Optimization: Handling Huge Datasets in EF Core
Database Query Optimization is key for efficient EF Core & large datasets. Learn practical techniques to boost query speed & app responsiveness, even with millions of records! #DB2Optimization #SQLQueryOptimization #DatabaseTuning #EFCoreOptimization #LargeDatasetOptimization #QueryPerformance
https://tech-champion.com/database/database-query-optimization-handling-huge-datasets-in-ef-core/
Learn database query optimization techni...
Learn to Optimize SQL Queries for faster, cleaner code! This post shows how combining multiple SELECT statements into a single, well-structured query improves efficiency using CTEs & other methods. #SQLoptimization #SQLqueries #Databaseoptimization #CTEs #queryperformance #efficientSQL https://tech-champion.com/database/optimize-sql-queries-combining-multiple-select-queries-for-efficiency