Common problems with SQL - Too clever constructs

It is said that "A road to hell is paved with good intentions," and it's true even for SQL queries. A lot of problems is caused by developers who strive to optimize the database, frequently without necessary knowledge of the internals.

Common problems with SQL - Structure

Let's check another source of problems - structure of a table. Again, this is a very broad topic, so I'll present just one very common example, I guess you'll be able to come up with many variants.

Common problems with SQL - Indexes

And now let's check some problems with the SQL queries and indexes. There are two basic problems related to indexes - using an index when the index should not be used (false positive) and not using an index when it should be used (false negative). If you don't know what indexes are or if you're not sure how they work, read something about it - for example my article basic principles of database indexes describes basics of indexes.

Common problems with SQL - administrator mistakes

It may be surprising, but many of the performance problems with SQL statements are originally caused by mistakes of the administrators. Some of these problems are closely related to the particalar database system. Thera are infinitely many ways to misconfigure a system or a database - let's check at least two quite frequent problems.

1