by Markus Winand.

Can you spot the five most common SQL indexing mistakes?

The 3-Minute SQL Indexing Quiz That 60% Fail


“SQL-Tuning is black magic
like alchemy:
it consists of obscure rules,
understood only by a handful
of insiders.”

That is a myth. SQL engines use well-known algorithms to deliver predictable performance. It is, however, easy to write SQL queries that cannot use the most efficient algorithm and thus deliver unexpected performance.

The following questions provide examples that might make you believe that SQL tuning is black magic. The explanations at the end are just a few sentences long and reveal that the black magic is pure science.

Choose a system

Db2 (LUW)MySQLOraclePostgreSQLSQL ServerSQLite

60% Fail?

I checked 28,000 results: only 40% answered more than three of the five questions correctly.

You consider three correct answers to five questions as failed?

Yes, because most questions have only two options. That gives you a 12.5% chance to pass the quiz by guessing. Accepting three correct answers would give you a chance of 29% to pass by guessing. That would be unreasonable, I think.

More about the results in this blog post. But remember to take the quiz first.

You can’t learn everything in one day. Subscribe the newsletter via E-Mail, Bluesky or RSS to gradually catch up. Have a look at modern-⁠sql.com as well.

About the Author

Photo of Markus Winand

Markus Winand provides insights into SQL and shows how different systems support it at modern-sql.com. Previously he made use-the-index-luke.com, which is still actively maintained. Markus can be hired as trainer, speaker and consultant via winand.at.

Buy the Book

Cover of “SQL Performance Explained”: Squirrel running on grass

The essence of SQL tuning in 200 pages

Buy now!
(paperback and/or PDF)

Paperback also available at Amazon.com.

Hire Markus

Markus offers SQL training and consulting for developers working at companies of all sizes.
Learn more »

Connect with Markus Winand

Subscribe mailinglistsSubscribe the RSS feedMarkus Winand on LinkedInMarkus Winand on XINGMarkus Winand on TwitterMarkus Winand on Bluesky
Copyright 2010-2025 Markus Winand. All righs reserved.
Legal | Contact | NO WARRANTY | Trademarks | Privacy and GDPR