Oracle因 Cursor 造成Hint失效
Oracle因Cursor造成Hint失效
SQL語法
1 | String sql = "SELECT /*+ INDEX (table table_index) */ userid " |
執行的結果
1 | select rowid as "Oracle_JDBC_interal_ROWID", /*+ INDEX (table table_index) */ userid |
結論
1 | 使用cursor的方式執行sql,jdbc 會自動塞入rowid 在select 後面,導致原本應該直接在select後面的hint失效。 |