Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

Why query plan changes by number of rows

$
0
0

I execute following two queries on an oracle database:

select * from qsn join plc on plc.fk_qsn = qsn.id where rownum < 48507

which returns result in less than a second and with following execution plan

enter image description here

and

select * from qsn join plc on plc.fk_qsn = qsn.id where rownum < 48508

which takes more than 10 seconds to execute and uses following execution plan

enter image description here

Can anyone help me understand the reason why this strange behavior happens?


Viewing all articles
Browse latest Browse all 717

Trending Articles