74

3-Minute Test: What do you know about SQL performance?

 6 years ago
source link: https://use-the-index-luke.com/3-minute-test
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Can you spot the five most common SQL indexing mistakes?

The 3-Minute SQL Indexing Quiz That 60% Fail


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

That is a myth. SQL databases 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 database

DB2 LUWMySQLOraclePostgreSQLSQL ServerSQLite

60% Fail?

correct_answers_given.Rit5oOg8.png

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.

About the Author

Photo of Markus Winand

Markus Winand is the SQL Renaissance Ambassador. He is on a mission to introduce developers to the evolution of SQL in the 21st century. Markus can be hired as trainer, speaker and consultant via winand.at.

Buy his Book

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 any size.
Learn more »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK