Live data from Hacker News

Results of the SQL Performance Quiz

use-the-index-luke.com

1–10 of 98 posts

Re: Results of the SQL Performance Quiz

#4
The fact that something like this is necessary just goes to show you how much of a failure SQL is compared to what it was supposed to be.

Remember the promise of a "declarative language" where you just had to tell it what you want, and it took care of the details?

Re: Results of the SQL Performance Quiz

#5
Regarding #5: >That caught me by surprise. Both options “roughly the same” and “depends on the data” got about 25% — the guessing probably.

I don't think it was guessing so much as reasoning that fetching 100 rows (and filtering by value) instead of 10 rows doesn't have significant real-world impact unless the row data is particularly large. I'll admit I didn't think of the out-of-index lookup, but my main thought was 100/1000000 vs 10/1000000 isn't a big deal unless the DB is running on an abacus.

Re: Results of the SQL Performance Quiz

#6
post #2

Maybe I'm just a bit slow, but what's going on with the 50/50 "guessing score" reasoning? Surely, you should half the wrong answers as well, rather than just subtracting it from the right answers?!?

If someone guessed incorrectly, they still didn't know the answer.

Re: Results of the SQL Performance Quiz

#7
I consider the critical path to SQL performance to be understanding what the data looks like and the type of queries to be executed against it rather than general guidelines.

To be frank, knowing the difference in how to write an inner and outer join when given a three table schema and a desired output is a frightening filter of candidates. Having an instinct that some type of index could help a query probably makes you a db wizard.

Re: Results of the SQL Performance Quiz

#8
Hmmm, I'm no SQL jockey, rarely deal with it directly, and currently work with MongoDB. I got 5-of-5 on the PostgreSQL flavor of the test but am sure I'd fail a whiteboard interview on SQL particulars. Being a generalist I can usually figure things out and think I have an intuitive grasp of issues involved in many systems -- but unfortunately only 30% of workplaces understand that intuition, adaptability, and general experience usually trump specific knowledge.

Fortunately I've landed pretty good jobs in spite of employer myopia, and work for a SV salary and a SV company though I live in a non-tech town in North Carolina. Just venting a frustration.

Post reply on HN