Skip to Main Content

Oracle Database Discussions

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!

Query is slow while selecting small amount of data

arifAug 28 2018 — edited Aug 28 2018

Hi,

We have 11gR2 Production database. Table APP.CDR size is 8 TB.

Application team is using following query and getting result within few seconds from this large table.

select * from APP.CDR where apartynumber=8807655083815

But when they use below query to get smaller data set by filtering by between clause, it is taking time to get the output.

select * from APP.CDR where apartynumber=8807655083815 and to_char(to_date(SDATE,'dd/mm/yyyy'),'yyyymmdd') between '20180827' and '20180828'

Please help me to find out the answer, when they are selecting larger amount of data (first query) the output is coming quickly but when they try to select small amount of data (second query) it is taking time to get the output whereas both query is similar. Why is so?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2018
Added on Aug 28 2018
4 comments
333 views