Markus Winand's Blog

Joe Celko reviews “SQL Performance Explained”

In Uncategorized on 2012-11-15 at 17:25

This is just a short note to point you to Joe Celko’s review of “SQL Performance Explained”. Yes, Joe Celko read my book :)

Here is the full review.

And remember: we are offering free shipping to 150+ countries on https://sql-performance-explained.com/.


Do not use offset for pagination. Learn why.

Choosing NoSQL For The Right Reason

In Performance, Reliability, Scalability on 2011-05-13 at 09:42

Observing the NoSQL hype through the eyes of an SQL performance consultant is an interesting experience. It is, however, very hard to write about NoSQL because there are so many forms of it. After all, NoSQL is nothing more than a marketing term. A marketing term that works pretty well because it goes to the heart of many developers that struggle with SQL every day.

Finding the Best Match With a Top-N Query

In Performance on 2010-09-29 at 11:16

There was an interesting index related performance problem on Stack Overflow recently. The problem was to check an input string against a table that holds about 2000 prefix patterns (e.g., LIKE 'xyz%'). A fast select is needed that returns one row if any pattern matches the input string, or no row otherwise.

I believe my solution is worth a few extra words to explain it in more detail. Even though it’s a perfect fit for Use The Index, Luke it’s a little early to put it as an exercise there. It is, however, a very good complement to my previous article Analytic Top-N queries—so I put it here.

Although the problem was raised for a MySQL database, my solution applies to all databases that can properly optimize Top-N queries.