Changing plans (hint hint)
Most database systems provide some way to influence the execution plan - typically via ‘hints’
Oracle supports a very large and complex range of hints
- Hints must be contained within special comments /*+ … */
SELECT /*+ INDEX(table1 index1) */ foo, bar
FROM table1 WHERE key1=1 AND key2=2 AND key3=3;
MySQL has a very limited set of hints
- Hints can optionally be placed inside comments /*! … */
SELECT foo, bar FROM table1 /*! USE INDEX (key1,key2) */
WHERE key1=1 AND key2=2 AND key3=3;