~/devreads

#sql performance

5 posts

6 Nov 2017

lukaseder 1 min read

Usually, this blog is 100% pro window functions and advocates using them at any occasion. But like any tool, window functions come at a price and we must carefully evaluate if that’s a price we’re willing to pay. That price can be a sort operation. And as we all know, sort operations are expensive. They … Continue reading How to…

sqlorder byperformancesort operationsql performance

28 Sept 2017

lukaseder 1 min read

Cost Based Optimisation is the de-facto standard way to optimise SQL queries in most modern databases. It is the reason why it is really really hard to implement a complex, hand-written algorithm in a 3GL (third generation programming language) such as Java that outperforms a dynamically calculated database execution plan, that has been generated from … Continue reading 10 Cool…

sqljoin eliminationsql optimisationsql performancesql transformation

31 May 2017

lukaseder 1 min read

I stumbled upon an interesting question on Stack Overflow recently. A user wanted to query a table for a given predicate. If that predicate returns no rows, they wanted to run another query using a different predicate. Preferably in a single query. Challenge accepted! Canonical Idea: Use a Common Table Expression We’re querying the Sakila … Continue reading How to…

sqlcommon table expressionoraclepostgresqlsql performance

8 May 2017

lukaseder 1 min read

A large-ish customer in banking (largest tables on that particular system: ~1 billion rows) once decided to separate the OLTP database from the “log database” in order to better use resources and prevent contention on some tables, as the append-only log database is used heavily for analytic querying of all sorts. That seems to make … Continue reading The Difficulty…

sqldatabase linksoracleremote databasesql performance

3 Feb 2015

lukaseder 1 min read

We’ve been blogging a lot about the merits of modern SQL on the jOOQ blog. Specifically, window functions are one of the most fascinating features. But there are many many others. Markus Winand, author of the popular book SQL Performance Explained has recently given a very well-researched talk about modern SQL. We particularly like his … Continue reading Still Using…

sqlmarkus winandmodern sqlsql 92sql performance