Query taking time to execute in front end(Oracle 10g R2) [message #313868] |
Mon, 14 April 2008 23:53 |
anee459
Messages: 14 Registered: March 2008
|
Junior Member |
|
|
Hi,
select inv_no from imp_bl_top
where eta_date between to_date(:blk2.date_from,'dd-MON-yyyy')
and to_date(:blk2.date_to,'dd-MON-yyyy')
and ((:blk2.ocean_air = 'A' and fcl_lcl = 'A') or (:blk2.ocean_air = 'O' and fcl_lcl in ('F','L','C')))
Now this query fetches only 11 records
from total 601873.
When i execute this query in back end
i.e. Sql*plus it takes only 0.78 sec but
when actually it executes on form it takes
about 30 sec to execute.
Can anybody please tell me what can be the problem.
And provide some suggestion what further should i do.
I have created an index on fcl_lcl,inv_no,eta_date.
[Updated on: Tue, 15 April 2008 00:26] by Moderator Report message to a moderator
|
|
|
|
Re: Query taking time to execute in front end(Oracle 10g R2) [message #313876 is a reply to message #313870] |
Tue, 15 April 2008 00:06 |
anee459
Messages: 14 Registered: March 2008
|
Junior Member |
|
|
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=605 Card=451
Bytes=9471)
1 0 FILTER
2 1 INLIST ITERATOR
3 2 INDEX (RANGE SCAN) OF 'IMP_BL_TOP_INDEX' (INDEX) (Cost
=605 Card=451 Bytes=9471)
This is the execution plan of the above query.
|
|
|
|
|
Re: Query taking time to execute in front end(Oracle 10g R2) [message #313976 is a reply to message #313944] |
Tue, 15 April 2008 06:43 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Run the query from the Form.
Look in V$session and identify the session that Forms is using.
Look in v$sqlplan for the HASH_VALUE corresponding to the SQL_HASH_VALUE from that V$session record.
Failing that, have a search through v$sql_plan for queries using the tables that your query uses until you find the right one.
Then let us see what the other plan looks like.
|
|
|
|
|
|
|
Re: Query taking time to execute in front end(Oracle 10g R2) [message #314629 is a reply to message #314616] |
Thu, 17 April 2008 05:49 |
anee459
Messages: 14 Registered: March 2008
|
Junior Member |
|
|
select inv_no from imp_bl_top
where eta_date between to_date(:blk2.date_from,'dd-MON-yyyy')
and to_date(:blk2.date_to,'dd-MON-yyyy')
and ((:blk2.ocean_air = 'A' and fcl_lcl = 'A') or (:blk2.ocean_air = 'O' and fcl_lcl in ('F','L','C')))
This is the actual query which is fetching out 11
records from the total records in the table.(ie 607843).
And the time taken to fetch this records is more.
This is the main problem.
|
|
|
|
|