title: jOINING tables with millions of rows
body: <p>i have the sql below that returns 35k rows and take about 10 mins to run. both tables have millions of row. how can i improve this sql?</p>
  
  <pre><code>SELECT /*+ index(T_DIRECTORY X_DIR) */ 
                   DIRx.dir_id ,                   
                   base.id       
                   FROM T_DIRECTORY DIRx,  T_PERSON base 
                   WHERE 
                     DIRx.id = 26463
                     and DIRx.PERSONID=  base.PERSONID
  
  '| Id  | Operation                    | Name           |'
  '-------------------------------------------------------'
  '|   0 | SELECT STATEMENT             |                |'
  '|   1 |  NESTED LOOPS                |                |'
  '|   2 |   TABLE ACCESS BY INDEX ROWID| T_DIRECTORY |'
  '|   3 |    INDEX RANGE SCAN          | X_DIRECTORY |'
  '|   4 |   TABLE ACCESS BY INDEX ROWID| T_PERSON      |'
  '|   5 |    INDEX UNIQUE SCAN         | I_PERSON      |'
  </code></pre>