Query runs slow inside class file [message #299387] |
Mon, 11 February 2008 15:54 |
guestuser1004
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
Hi Guys,
The below query runs with in 5 Second in Oracle SQL+, but take 5 minutes to run inside my Java code...Any insight on this.
SELECT clientcode,formtype,scandate FROM ml_bsl_s where (clientcode NOT IN (SELECT CLNT_CD FROM tb_bsl_client ));
I am having a Oracle connection String inside My class file and executing the query.
|
|
|
|
|
Re: Query runs slow inside class file [message #299584 is a reply to message #299443] |
Tue, 12 February 2008 09:01 |
guestuser1004
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
Frank,
I am executing the query from my class file.
Its this below part
clientcode NOT IN (SELECT CLNT_CD FROM tb_bsl_client )
Michel,
I tried array, not sure what prefetch size is and would do.
Could u elamorate it a bit.
Thanks
|
|
|
|
Re: Query runs slow inside class file [message #299617 is a reply to message #299584] |
Tue, 12 February 2008 13:41 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
guestuser1004 wrote on Tue, 12 February 2008 16:01 |
clientcode NOT IN (SELECT CLNT_CD FROM tb_bsl_client )
|
Sorry, but (by itself) this is not a query.
Furthermore, you claim that you execute the same query from both sqlplus and java. That means that either you are mistaken, and the two differ, or it is some overhead that is taking time (eg creating connections, whatever).
That is why I asked you if you timed which part of the class takes the bigger part of the 5 minutes
|
|
|
Re: Query runs slow inside class file [message #299618 is a reply to message #299617] |
Tue, 12 February 2008 13:44 |
guestuser1004
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
Frank,
Every thing is fast in my java class except when I put this query
SELECT clientcode,formtype,scandate FROM ml_bsl_s where (clientcode NOT IN (SELECT CLNT_CD FROM tb_bsl_client ));
Works good for
SELECT clientcode,formtype,scandate FROM ml_bsl_s,tb_bsl_client where (ml_bsl_s.clientcode = tb_bsl_client.CLNT_CD ));
|
|
|
|
|
|
|
Re: Query runs slow inside class file [message #299623 is a reply to message #299622] |
Tue, 12 February 2008 13:56 |
guestuser1004
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
Got the below from SQL PLUS
Opration Object Name Table Access
Table Access ML_BSL_S 6
Table Access TB_BSL_CLIENT 138
recursive calls 125
db block gets 0
consistent gets 967
physical reads 933
redo size 0
bytes sent via SQL*Net to client 1129
bytes received via SQL*Net from client 681
SQL*Net roundtrips to/from client 9
sorts (memory) 6
sorts (disk) 0
Not sure about the JAVA SQL TRACE.
|
|
|
|
|