What are your most common SQL optimization that you used?
Lowering transaction isolation levels to get around table locks for user queries. Not all the time, but for gui's showing general information it works great.
Do not put constraints if not required as constraints will add an index, the more number of indexes, the more time it takes for data insertion.
By far and above: Making covering indexes
A covering index includes all the columns that the query will need, thereby avoiding the need to do lookups on the results of an index seek. This will then avoid the system feeling like a scan could be quicker (which is remarkably quick considering the cost of lookups).
But also worth mentioning:
Having an index that will allow a merge join. A MERGE join is able to occur when joining two tables that are ordered by the join conditions. But of course, in saying 'table', we really mean 'index', right...
Also - removing scalar functions and using table-valued functions instead... as scalar functions are not able to be simplified out.
Also - putting a unique index on a column that you know to be unique, allowing the query optimizer to use this knowledge to make better optimization choices. Also applies to NOT NULL constraints.
Also - using Binary collation when comparing strings that are in a known case, so that the system doesn't have to consider the different case options.
Of course I could go on all day...
Rob
If you're talking common as in really common then Indexes are the first thing that pops up into my head.
They are a powerful technique that are often misunderstood and quite often abused.
Then I would place de-normalization which can add in quite a bit of performance for many databases.
Query optimization is third and it helps a lot too. I use MySQL these days and Query logging helps a lot for optimization.
Memcached is definitely not common, though caching of some sort is a part of many websites at the scripting end (ASP.Net or PHP).
Reducing the amount of data that is returned, by only returning the fields required and only returning the rows required. This is the most common, as you do it for every query that returns data.
Adding indexes. This is not done as frequently, as some tables doesn't need any other index than the one created for the primary key.
Caching db output. Avoiding pressuring the database at all seems to be a prudent optimization.
+1 memcached.