How To Force Oracle To Use Full Table Scan

Usually we need to execute a statement  as fast as possible and with minimal resource cost. Our first thought as a solution is the use of indexes, but not always is the solution, there are times when we want to access by FTS, of course you can force the full by using hints.


Create a table and an index



See the default execution plan



Now we force the full, we must say that in this case the object_id is number.



Add zero to object_id cancel the use of index. It should be noted also that this is a very common mistake when writing sql sentences, since it avoids the use of indexes when we want to use them.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s