Home » RDBMS Server » Performance Tuning » performance issue with the query (Oracle 11G)
performance issue with the query [message #588865] |
Sat, 29 June 2013 01:58  |
ajaykumarkona
Messages: 399 Registered: August 2010
|
Senior Member |
|
|
Hi Experts,
This query is fetching 500 records.
SELECT
RECIPIENT_ID ,FAX_STATUS
FROM
FAX_STAGE WHERE LOWER(FAX_STATUS) like 'moved to%'
Execution Plan
----------------------------------------------------------
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 159K| 10M| 2170 (1)|
| 1 | TABLE ACCESS BY INDEX ROWID| FAX_STAGE | 159K| 10M| 2170 (1)|
| 2 | INDEX RANGE SCAN | INDX_FAX_STATUS_RAM | 28786 | | 123 (0)|
----------------------------------------------------------------------------------------
Note
-----
- 'PLAN_TABLE' is old version
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
21 consistent gets
0 physical reads
0 redo size
937 bytes sent via SQL*Net to client
375 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
19 rows processed
Total number of records in the table.
SELECT COUNT(*) FROM FAX_STAGE--3679418
Distinct reccords are low for this column.
SELECT DISTINCT FAX_STATUS FROM FAX_STAGE;
Completed
BROKEN
Broken - New
moved to - America
MOVED to - Australia
Moved to Canada and australia
Functional based index on FAX_STAGE(LOWER(FAX_STATUS))
stats are up to date.
Still the cost is high
How to improve the performance of this query.
Please help me.
Thanks in advance.
|
|
|
|
|
|
|
|
Re: performance issue with the query [message #588969 is a reply to message #588968] |
Mon, 01 July 2013 02:30   |
John Watson
Messages: 8976 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Before attempting to tune SQL, you should learn how to run a script with SQL*Plus. You should also earn how to write a query that uses COUNT and GROUP BY.
At the moment, I see no point in proceeding.
---
Update, JW:
And one more thing: you should NEVER use the ANALYZE command. It is deprecated, and will break your histograms.
[Updated on: Mon, 01 July 2013 02:32] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sun May 04 10:41:09 CDT 2025
|