The following list illustrates hints for improving query structure:
In some cases, command statements that include subqueries can also be formulated as joins and may run faster.
If you group on multiple columns in a GROUP BY clause, list the columns by descending order by number of unique values if you can. This will give you the best query performance.
Join indexes can often cause join queries to execute faster than ad hoc joins, at the expense of using more disk space and significantly increase load time. However, when a join query does not reference the largest table in a multi-table join index or the difference in row counts between the smaller and larger table is large, an ad hoc join usually outperforms the join index.
You can improve performance by using an additional column to store frequently calculated results.
Queries involving columns that have a significant number of NULL values run faster than in previous releases. The process of inserting or updating data in a table, however, may take longer (compared with previous releases) in cases where a significant number of NULL values are being inserted into the table.