![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
On Oracle 10 hosted on a FreeBSD server, I am seeing a disproportionate difference in response time between two queries which should take same amount of time. my_folder is a table with only 22,000 entries. Query 1 : * (takes 22-23 seconds) select f.foldername from my_folder f * * where f.foldername in (select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * * * * where some-conditions) * * and f.foldername.isactive = 1 ; Query 2 : *(I aborted it after 15 minutes) select f.foldername from my_folder f * * where f.foldername * not *in *(select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * * * * where some-conditions) * * and f.foldername.isactive = 1 ; The only difference is that query 2 uses 'NOT IN' clause instead of 'IN' clause. Why should this happen? |
#3
| |||
| |||
|
|
On 13 July, 05:38, "dn.p... (AT) gmail (DOT) com" <dn.p... (AT) gmail (DOT) com> wrote: On Oracle 10 hosted on a FreeBSD server, I am seeing a disproportionate difference in response time between two queries which should take same amount of time. my_folder is a table with only 22,000 entries. Query 1 : * (takes 22-23 seconds) select f.foldername from my_folder f * * where f.foldername in (select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * ** * where some-conditions) * * and f.foldername.isactive = 1 ; Query 2 : *(I aborted it after 15 minutes) select f.foldername from my_folder f * * where f.foldername * not *in *(select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * ** * where some-conditions) * * and f.foldername.isactive = 1 ; The only difference is that query 2 uses 'NOT IN' clause instead of 'IN' clause. Why should this happen? Generate an explain plan for each query. HTH -g- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
On Oracle 10 hosted on a FreeBSD server, I am seeing a disproportionate difference in response time between two queries which should take same amount of time. my_folder is a table with only 22,000 entries. Query 1 : * (takes 22-23 seconds) select f.foldername from my_folder f * * where f.foldername in (select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * * * * where some-conditions) * * and f.foldername.isactive = 1 ; Query 2 : *(I aborted it after 15 minutes) select f.foldername from my_folder f * * where f.foldername * not *in *(select f1.foldername from my_folder f1, my_aa a, my_bb b * * * * * * * * * * * * * * * * * * * * where some-conditions) * * and f.foldername.isactive = 1 ; The only difference is that query 2 uses 'NOT IN' clause instead of 'IN' clause. Why should this happen? |
![]() |
| Thread Tools | |
| Display Modes | |
| |