Posts

Showing posts from June, 2026

Oracle Hints

  Hints   Sl. No. Hint Name Example Do/Don’t 1. FULL SELECT /*+ FULL(emp) */ * FROM emp; Do when Table scan is cheaper than index (large result set) Data warehouse / batch queries Index is highly fragmented or low selectivity Don’t do when OLTP queries Highly selective predicates   2. INDEX SELECT /*+ INDEX(emp emp_idx1) */ * FROM emp WHERE empno=100; Do When Optimizer ignores a good index Predicate is highly selective   Don't Do When Index clustering factor is poor Query returns large % of table 3. INDEX_FFS (Fast Full Scan) SELECT /*+ INDEX_FFS(emp emp_idx1) */ empno FROM emp; Do When Index contains all required columns Avoids table access Batch/reporting queries   Don't Do When...