Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Count(*) vs exists on non indexed columns

vijzMay 8 2018 — edited May 8 2018

Apologies, for not providing table data

For a given  two non indexed tables (for some reason) with more than million records.

Which is the best option among the below to check if record exists:

A. Cost to execute query

B. Time to execute query

1.(Select Count(*) from tables where <condition> and rownum=1)>0

2.  Exists(Select null from tables where <condition>

This post has been answered by Sven W. on May 8 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2018
Added on May 8 2018
22 comments
1,149 views