When I've seen this article back in my RSS reader, it reminded me of one particular query that was generated in the application I'm maintaining. My irrational fear of sending too many queries to the database (I've outgrown that in the last 6 years) caused a single query to be generated which was 4KB in size.
Which of course is much less than the one in the picture, but still very, very bad.
Some so we've refactored the beast. Now it's 2-3 smaller queries (which are much easier to optimize for PostgreSQL and, above all, individually cacheable) which lead to a nearly 100% speedup for common cases. Also, the code is infinitely more readable which means that it's much easier to extend it.
I'm incredibly happy that we've seen the light and fixed it before it grew to proportions like the ones on the original article shudder
4KB? That's nothing. Search for 'media.sql' in any recent Adobe installation media. You'll find 3 MB+ SQL files, containing:
-(BASE64?) encoded InstallerIcon,
-(BASE64?) encoded EULAs in various languages
-GUIDs like {01C3BD72-7371-4472-B179-B4DFE6DDD251}
-and my personal favorite: a 25 KB XML fragment
There was a source control system whose code I had the pleasure of reading several months ago whose favorite way to store data was as a SQLite3 database, with a single table, with a single column, with a single row, containing JSON. Words failed me.
Based on what you're describing, I now believe those developers were poached from Adobe.
It's common to use SQLite for data storage in Mac OS X, but 3MB SQLite databases aren't the same thing as a 4KB database query, which is the horror the original comment was admitting to. :o)
Which of course is much less than the one in the picture, but still very, very bad.
Some so we've refactored the beast. Now it's 2-3 smaller queries (which are much easier to optimize for PostgreSQL and, above all, individually cacheable) which lead to a nearly 100% speedup for common cases. Also, the code is infinitely more readable which means that it's much easier to extend it.
I'm incredibly happy that we've seen the light and fixed it before it grew to proportions like the ones on the original article shudder