Please find explain plan and Table structure here.
asked Feb 18 '13 at 11:39 Ravi Kiran |
Try to add an index with the columns "precedence" and "fake_uri". If the database don't use your index, the optimizer possibly think it's faster to do a full table scan. You can add "force index(yourindexname)" after "from site_ map_template" and then the query has to use this index. This is not an optimal solution because it could be faster without this index or with another index. With "use index()" the query may use this index if it's faster for the optimizer (I think). I had some simple queries which don't use the index because it's no benefit. If I'm wrong with the optimizer, correct me. answered Feb 23 '13 at 17:25 sql_sniffer |
The same example could work in Oracle. Oracle may try to combine two indexes before and use the result while accessing a table. answered Sep 03 '13 at 22:10 nmaqsudov |