Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

2 Answers
2

not necessarily - it depends on whether a suitable index exists and whether the CBO decides to use it. For example if the table is small or the the statistics lead the optimizer to believe that the filter will be true for a large percentage of the results, it may consider the cost of a FTS to be lower

this is not guaranteed - it is even possible that the 2nd query will perform worse - but your reasoning is fundamentally sound. For example, in an edge case when a FTS would actually be faster, the CBO may choose an index scan instead based on its best guess of the cost - which is always only an estimate of course