Oracle
I've been reading an oracle book called 'Oracle SQL Hihg-Performance Tuning, 2nd Edtion' by Guy Harrison. Below is a list of useful ideas/tips from the book.
* CURSOR_SHARING option in Oracle 8.1.6
When this option is set FORCE, Oracle will transparently rewrite any SQL statement to use bind variables.
ALTER session set cursor_sharing=FORCE
* SORT MERGE join
Sort the 2 involved tables in a join and merge the 2 sorted set 1 by 1
* Nested Loops join
One of the table is indexed and the other one not(usually a smaller table or the intermediate resultset). The smaller table is scanned through and the result found will be joined to the indexed table. The resulting resultset will not be of any particular order.
* Hash Join
A hash table(a sort of on-the-fly index) is created for the larger of the 2 tables. The smaller one is then scanned and the hash table is used to find the matching rows in the larger table.