Regarding perfrommance tuning
hi expert,
i am having 5 millions records i want to insert record in a table which statement is faster from following.
1 insert into test1 values() select * from test
2 using bulk collect
plz can me help me which one is the improvement of performance. plz advice me expert.
thnks in advance
Among other things, it will depend on
- Whether you're doing direct-path operations
- Your I/O rate
- Your network bandwidth
- Your CPU horsepower
- Whether you can parallelize the database link approach
That's why I suggested benchmarking it in your particular environment. There is no way to know for sure in advance which approach is going to be more efficient. Of course, export and import is clearly the easier option, since it requires no code.
Justin
Similar Messages
-
I want to create an ALV report to display the Purchase Order Details, the data will come from 4 Database tables,I am extracting the data in 4 internal tables and then clubbing them to one final internal table,but the performance of my program is very bad,please suggest me some way.
hi,
first avoid occurs o etc.
delcare internal tables using types for structure and data with header line.
check for sy-subrc =0. for select statements ,use delete adjacent duplicates.
if there is large amount of data ise LIST display instead of grid.
for further performance issues chaeck below links.
BAP performance depends upon various factors and in devicded in three parts:
1. Database
2. ABAP
3. System
Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.
u can get an interactive grap in SE30 regarding this with a file.
also if u find runtime of parts of codes then use :
Switch on RTA Dynamically within ABAP Code
*To turn runtim analysis on within ABAP code insert the following code
SET RUN TIME ANALYZER ON.
*To turn runtim analysis off within ABAP code insert the following code
SET RUN TIME ANALYZER OFF.
Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
Avoid for all entries in JOINS
Try to avoid joins and use FOR ALL ENTRIES.
Try to restrict the joins to 1 level only ie only for tables
Avoid using Select *.
Avoid having multiple Selects from the same table in the same object.
Try to minimize the number of variables to save memory.
The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
Avoid creation of index as far as possible
Avoid operators like <>, > , < & like % in where clause conditions
Avoid select/select single statements in loops.
Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
Avoid using ORDER BY in selects
Avoid Nested Selects
Avoid Nested Loops of Internal Tables
Try to use FIELD SYMBOLS.
Try to avoid into Corresponding Fields of
Avoid using Select Distinct, Use DELETE ADJACENT
Go through the following Document
Check the following Links
Re: performance tuning
Re: Performance tuning of program
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance
and
books like
http://www.sap-press.com/product.cfm?account=&product=H951
http://www.sap-press.com/product.cfm?account=&product=H973
http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Performance tuning for Data Selection Statement
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
CATT - Computer Aided Testing Too
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
Test Workbench
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
ECATT - Extended Computer Aided testing tool.
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
Just refer to these links...
performance
Performance
Performance Guide
performance issues...
Performance Tuning
Performance issues
performance tuning
performance tuning -
ADDM recommendation regarding SQL Tuning
Hi all.
Several times, I've seen this recommendation when I run ADDM:
Recommendation 1: SQL Tuning
Estimated benefit is 1.78 active sessions, 4.93% of total activity.
Action
Tune the PL/SQL block with SQL_ID "9f9y14fzgg9a9". Refer to the "Tuning
PL/SQL Applications" chapter of Oracle's "PL/SQL User's Guide and
Reference".
Related Object
SQL statement with SQL_ID 9f9y14fzgg9a9.
declare
rc__ number;
simple_list__ owa_util.vc_arr;
complex_list__ owa_util.vc_arr;
begin
owa.init_cgi_env(:n__,:nm__,:v__);
htp.HTBUF_LEN := 255;
null;
null;
simple_list__(1) := 'sys.%';
simple_list__(2) := 'dbms\_%';
simple_list__(3) := 'utl\_%';
simple_list__(4) := 'owa\_%';
simple_list__(5) := 'owa.%';
simple_list__(6) := 'htp.%';
simple_list__(7) := 'htf.%';
simple_list__(8) := 'wpg_docload.%';
if ((owa_match.match_pattern('adhoc_run.submit_rep', simple_list__,
complex_list__, true))) then
rc__ := 2;
else
null;
null;
adhoc_run.submit_rep(NAME_ARRAY=>:NAME_ARRAY,VALUE_ARRAY=>:VALUE_ARRA
Y);
if (wpg_docload.is_file_download) then
rc__ := 1;
wpg_docload.get_download_file(:doc_info);
null;
null;
null;
commit;
else
rc__ := 0;
null;
null;
null;
commit;
owa.get_page(:data__,:ndata__);
end if;
end if;
:rc__ := rc__;
end;
Rationale
SQL statement with SQL_ID "9f9y14fzgg9a9" was executed 206 times and had
an average elapsed time of 46 seconds.
My understanding is that this is an embedded APEX routine I can't control.
Question for the gurus out there:
- Have you seen this before?
- Is there any way to tune this (any parameter, etc.)? Any recommendation?
Thanks a lot,
Ignacio.Hi,
How about SQL Profiles? Have thought in this direction?
Some info is here http://www.oracle-base.com/articles/10g/AutomaticSQLTuning10g.php
Regards, -
hi,
i have developed a report program.its taking too much time to fetch the records.so what steps i have to consider to improve the performance. urgent plz.Hi,
Check this links
Performance tuning for Data Selection Statement & Others
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
http://www.sapdevelopment.co.uk/perform/performhome.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
1. Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
2. Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
3. SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
6. Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
7. Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
8. Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
http://sap.genieholdings.com/abap/performance.htm
http://www.dbis.ethz.ch/research/publications/19.pdf
Reward Points if it is Useful.
Thanks,
Manjunath MS -
Hi,
I am executing this query but it is taking more time to execute.
SELECT TO_CHAR(A.CALLEND,'MON-YYYY')ROAMERMONTH,
C.OPCCIRCLE INROAMCIRCLE,
COUNT(DISTINCT (A.CDPADIGITS))INROAMERCOUNT,
B.DPCCIRCLE OUTROAMCIRCLE,
C.REPORTOPERATORNAME INROAMREPORTOPERATORNAME,
B.REPORTOPERATORNAME OUTROAMREPORTOPERATORNAME
FROM TBLMEDRATINTRIM_DETAIL_ROAM A,
ROAMDPCNEW B,
ROAMOPCNEW C
WHERE A.DPC not in ('002-045-004') AND A.OPC not in ('004-008-000')
AND A.DPC=B.DPC
AND A.OPC=C.OPC
AND TO_CHAR(A.CALLEND,'MON-YYYY')= 'OCT-2009'
GROUP BY TO_CHAR(A.CALLEND,'MON-YYYY'),B.DPCCIRCLE,C.OPCCIRCLE,C.REPORTOPERATORNAME,B.REPORTOPERATORNAME;
How can i write this query so it will take less time to execute.
HOW to Tune this query?[How to post a SQL statement tuning request|http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0]
[When your query takes too long...|http://forums.oracle.com/forums/thread.jspa?messageID=1812597#1812597]
And when you post source code:
{{noformat}code{noformat}}
....Post Your Code Here....
{{noformat}code{noformat}} -
I have two table SDTM_EG,SDTM_SP both have same table structure and indexes.toatl count from both table is SDTM_EG=560066,SDTM_SP=821651.
While i run query select count(*) from each table then it will take time As SDTM_EG=9 Sec and SDTM_SP=5esc.
when i saw table size from dba_segments means i run query
select sum(bytes/1024/1024) from dba_segments where OWNER='SDTMREPOSITORY' and SEGMENT_NAME='SDTM_EG';
'SDTM_EG'=1280;'SDTM_SP'=312.
wether this effect on my query for retriving data.Means whenever i run any script on SDTM_EG table it take more time as compare to SDTM_SP.
Please suggest solution for this .Hi:
Please do an explain plan on your query and see if it is using the right plan. If you are running on CBO please make sure relevant statistics are collected on the tables. There are so many factors that determing why query on that particular table is slow. Missing index , Wrong statistics and wrong join order just to name a few. Doing an explain plan in most cases will help you what might have gone wrong.
Regards,
BMP -
Regarding performance tuning for BSEG & BKPF table data fetch
Hi Friends:
Plz see the below select queries. This is really impacting the performance of my report. Plz suggest the steps to increase the performance of the report.Points will be rewarded.
Thanks:
FORM GET_DATA .
Selecting the Document number from BSEG table
SELECT BELNR BUKRS FROM BSEG INTO TABLE L_DOC_NO
WHERE BUKRS IN S_BUKRS
AND GJAHR = P_GJAHR
AND HKONT IN S_SAKNR.
IF SY-SUBRC <> 0.
MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
ENDIF.
CLEAR L_DOC_NO.
SORT L_DOC_NO BY BELNR.
Selecting the Document Number Based on the selection-screen.
SELECT BELNR BUKRS BUDAT CPUDT BLART MONAT FROM BKPF INTO TABLE
L_BKPF
FOR ALL ENTRIES IN L_DOC_NO
WHERE BUKRS = L_DOC_NO-BUKRS AND
BELNR = L_DOC_NO-BELNR AND
GJAHR = P_GJAHR AND
BUDAT IN S_BUDAT AND
MONAT IN S_MONAT.
IF SY-SUBRC <> 0.
MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
ENDIF.
*Fetch the Line Items
SORT L_BKPF BY BELNR.
SELECT BELNR BUKRS BUZEI HKONT SHKZG WRBTR FROM BSEG INTO TABLE
L_BSEG
FOR ALL ENTRIES IN L_BKPF
WHERE BUKRS = L_BKPF-BUKRS
AND BELNR = L_BKPF-BELNR
AND GJAHR = P_GJAHR
AND BUZEI BETWEEN '001' AND '999'.Hi,
Let me understand your code first.
The below code (the 2 selects) gets data from BSEG first and then gets data from BKPF table.
"*Selecting the Document number from BSEG table
SELECT BELNR BUKRS FROM BSEG INTO TABLE L_DOC_NO
WHERE BUKRS IN S_BUKRS
AND GJAHR = P_GJAHR
AND HKONT IN S_SAKNR.
IF SY-SUBRC 0.
MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
ENDIF.
CLEAR L_DOC_NO.
SORT L_DOC_NO BY BELNR.
"*Selecting the Document Number Based on the selection-screen.
SELECT BELNR BUKRS BUDAT CPUDT BLART MONAT FROM BKPF INTO TABLE L_BKPF
FOR ALL ENTRIES IN L_DOC_NO
WHERE BUKRS = L_DOC_NO-BUKRS AND
BELNR = L_DOC_NO-BELNR AND
GJAHR = P_GJAHR AND
BUDAT IN S_BUDAT AND
MONAT IN S_MONAT.
IF SY-SUBRC 0.
MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
ENDIF.
The below code, can't you avoid by taking all the fields required on your 1st select on BSEG table?
*Fetch the Line Items
SORT L_BKPF BY BELNR.
SELECT BELNR BUKRS BUZEI HKONT SHKZG WRBTR FROM BSEG INTO TABLE
L_BSEG
FOR ALL ENTRIES IN L_BKPF
WHERE BUKRS = L_BKPF-BUKRS
AND BELNR = L_BKPF-BELNR
AND GJAHR = P_GJAHR
AND BUZEI BETWEEN '001' AND '999'.
Please check the below blog on "Performance of Nested Loops" by Rob Burbank which would be really helpful.
/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops
Hope this helps. Rwd points if helpful.
Thanks,
Balaji -
This is my first post in this forum regarding query tuning, so my sincere apologies in advance if I have:
1) not included sufficient information,
2) included too much information,
3) not posted to the correct forum
I read through Randolf Geist's web page on instructions to post a query tuning request
and attempted to follow it as closely as possible.
I am attempting to figure out where a view I have constructed can be optimized.
It takes approx. 45 seconds to 1 minute to run; I would like to cut that down to 10 seconds if possible.
The view itself is somewhat complex; I will post the actual code if it will help you help me. Please advise.
I was under the impression that posting the code was not necessary, but if it is, let me know and I will post it.
I have been doing SQL development for a few years, but only recently in Oracle.
I have no experience in looking through the following output and being able to tell where I can improve performance,
so this will be a learning experience for me. Thanks in advance for your help - I appreciate it.
Some additional information - my view is based on tables over which I have no control - it is a third-party application
which I do reporting from. I do have the freedom to create indexes on columns within the tables if necessary.
The statement is simply
SELECT * FROM LLU_V_PRODUCTION_DETAIL_03
which is the name of my view.
here's all the information I've been able to retrieve by following Randolf's instructions:
Oracle version is 10.2.0.1.0 - 64bit
Here are optimizer parameters:
NAME TYPE VALUE
user_dump_dest string C:\ORACLE\PRODUCT\10.2.0\ADMIN
\AXIUMPRODUCTION\UDUMP
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.2.0.1
optimizer_index_caching integer 90
optimizer_index_cost_adj integer 20
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
NAME TYPE VALUE
db_file_multiblock_read_count integer 16
NAME TYPE VALUE
db_block_size integer 8192
NAME TYPE VALUE
cursor_sharing string EXACT
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 10-29-2005 01:36
SYSSTATS_INFO DSTOP 10-29-2005 01:36
SYSSTATS_INFO FLAGS 1
SYSSTATS_MAIN CPUSPEEDNW 1298.56584
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM
SYSSTATS_MAIN MREADTIM
SYSSTATS_MAIN CPUSPEED
SYSSTATS_MAIN MBRC
SYSSTATS_MAIN MAXTHR
SYSSTATS_MAIN SLAVETHR
13 rows selected.Here is the output of EXPLAIN PLAN:
PLAN_TABLE_OUTPUT
Plan hash value: 662813077
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 23M| 53G| | 62330 (2)| 00:12:28 |
| 1 | VIEW | LLU_V_PRODUCTION_DETAIL_03 | 23M| 53G| | 62330 (2)| 00:12:28 |
| 2 | UNION-ALL | | | | | | |
|* 3 | HASH JOIN | | 18M| 5062M| | 1525 (10)| 00:00:19 |
| 4 | VIEW | index$_join$_007 | 1725 | 25875 | | 4 (25)| 00:00:01 |
|* 5 | HASH JOIN | | | | | | |
| 6 | INDEX FAST FULL SCAN | USERS_PRIMARY | 1725 | 25875 | | 1 (0)| 00:00:01 |
| 7 | INDEX FAST FULL SCAN | USERS_PRODUCER | 1725 | 25875 | | 2 (0)| 00:00:01 |
|* 8 | HASH JOIN | | 416K| 105M| | 1399 (2)| 00:00:17 |
| 9 | TABLE ACCESS FULL | PRODUCER | 1396 | 118K| | 24 (0)| 00:00:01 |
|* 10 | HASH JOIN | | 29819 | 5183K| | 1372 (2)| 00:00:17 |
| 11 | TABLE ACCESS FULL | CLASS | 20 | 1660 | | 3 (0)| 00:00:01 |
|* 12 | TABLE ACCESS FULL | QR_PRODUCTION | 149K| 13M| | 1367 (2)| 00:00:17 |
|* 13 | FILTER | | | | | | |
|* 14 | HASH JOIN | | 16M| 5651M| | 32983 (2)| 00:06:36 |
| 15 | VIEW | index$_join$_014 | 1725 | 25875 | | 4 (25)| 00:00:01 |
|* 16 | HASH JOIN | | | | | | |
| 17 | INDEX FAST FULL SCAN | USERS_PRIMARY | 1725 | 25875 | | 1 (0)| 00:00:01 |
| 18 | INDEX FAST FULL SCAN | USERS_PRODUCER | 1725 | 25875 | | 2 (0)| 00:00:01 |
|* 19 | HASH JOIN | | 149K| 49M| | 32874 (1)| 00:06:35 |
| 20 | TABLE ACCESS FULL | CLASS | 20 | 1660 | | 3 (0)| 00:00:01 |
|* 21 | HASH JOIN | | 149K| 37M| | 32870 (1)| 00:06:35 |
| 22 | TABLE ACCESS FULL | PRODUCER | 1396 | 118K| | 24 (0)| 00:00:01 |
|* 23 | HASH JOIN | | 222K| 37M| 12M| 32844 (1)| 00:06:35 |
| 24 | TABLE ACCESS FULL | PATIENT | 188K| 10M| | 6979 (1)| 00:01:24 |
|* 25 | HASH JOIN | | 222K| 24M| | 23860 (2)| 00:04:47 |
|* 26 | TABLE ACCESS FULL | PROCEDUR | 888 | 44400 | | 11 (0)| 00:00:01 |
|* 27 | TABLE ACCESS FULL | TRX | 442K| 28M| | 23845 (2)| 00:04:47 |
|* 28 | TABLE ACCESS FULL | USERS | 1 | 11 | | 55 (0)| 00:00:01 |
| 29 | NESTED LOOPS | | 1 | 473 | | 25798 (1)| 00:05:10 |
| 30 | NESTED LOOPS | | 1 | 413 | | 25797 (1)| 00:05:10 |
| 31 | NESTED LOOPS | | 1 | 398 | | 25796 (1)| 00:05:10 |
| 32 | NESTED LOOPS | | 1 | 390 | | 25795 (1)| 00:05:10 |
|* 33 | HASH JOIN | | 1 | 303 | | 25794 (1)| 00:05:10 |
| 34 | TABLE ACCESS FULL | LLU_EVALUATION_DESCRIPTIONS | 95 | 6175 | | 3 (0)| 00:00:01 |
|* 35 | HASH JOIN | | 4630 | 1076K| | 25791 (1)| 00:05:10 |
|* 36 | HASH JOIN | | 9607 | 1623K| | 23834 (1)| 00:04:47 |
| 37 | MERGE JOIN | | 888 | 91464 | | 13 (8)| 00:00:01 |
| 38 | TABLE ACCESS BY INDEX ROWID | CLASS | 20 | 1660 | | 1 (0)| 00:00:01 |
| 39 | INDEX FULL SCAN | CLASS_PRIMARY | 20 | | | 1 (0)| 00:00:01 |
|* 40 | SORT JOIN | | 888 | 17760 | | 12 (9)| 00:00:01 |
|* 41 | TABLE ACCESS FULL | PROCEDUR | 888 | 17760 | | 11 (0)| 00:00:01 |
|* 42 | TABLE ACCESS FULL | TRX | 19125 | 1307K| | 23820 (1)| 00:04:46 |
|* 43 | TABLE ACCESS FULL | GRADITEM | 655K| 40M| | 1952 (1)| 00:00:24 |
| 44 | TABLE ACCESS BY INDEX ROWID | PRODUCER | 1 | 87 | | 1 (0)| 00:00:01 |
|* 45 | INDEX UNIQUE SCAN | PRODUCER_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
|* 46 | TABLE ACCESS BY INDEX ROWID | GRADING | 1 | 8 | | 1 (0)| 00:00:01 |
|* 47 | INDEX UNIQUE SCAN | GRADING_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
| 48 | TABLE ACCESS BY INDEX ROWID | USERS | 221 | 3315 | | 1 (0)| 00:00:01 |
|* 49 | INDEX RANGE SCAN | USERS_PRODUCER | 1 | | | 1 (0)| 00:00:01 |
| 50 | TABLE ACCESS BY INDEX ROWID | PATIENT | 1 | 60 | | 1 (0)| 00:00:01 |
|* 51 | INDEX UNIQUE SCAN | PATIENT_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
| 52 | TABLE ACCESS BY INDEX ROWID | USERS | 109 | 1635 | | 1 (0)| 00:00:01 |
| 53 | NESTED LOOPS | | 1 | 438 | | 2023 (1)| 00:00:25 |
| 54 | NESTED LOOPS | | 1 | 423 | | 2022 (1)| 00:00:25 |
| 55 | NESTED LOOPS | | 1 | 363 | | 2021 (1)| 00:00:25 |
| 56 | NESTED LOOPS | | 1 | 276 | | 2020 (1)| 00:00:25 |
| 57 | NESTED LOOPS | | 1 | 193 | | 2019 (1)| 00:00:25 |
| 58 | NESTED LOOPS | | 1 | 185 | | 2018 (1)| 00:00:25 |
| 59 | NESTED LOOPS | | 1 | 173 | | 2017 (1)| 00:00:25 |
| 60 | NESTED LOOPS | | 1 | 140 | | 2016 (1)| 00:00:25 |
|* 61 | TABLE ACCESS FULL | GRADITEM | 317 | 23141 | | 1953 (2)| 00:00:24 |
|* 62 | TABLE ACCESS BY INDEX ROWID| TRX | 1 | 67 | | 1 (0)| 00:00:01 |
|* 63 | INDEX UNIQUE SCAN | TRX_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
|* 64 | TABLE ACCESS BY INDEX ROWID | TRX | 1 | 33 | | 1 (0)| 00:00:01 |
|* 65 | INDEX UNIQUE SCAN | TRX_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
|* 66 | TABLE ACCESS BY INDEX ROWID | GRADITEM | 1 | 12 | | 1 (0)| 00:00:01 |
|* 67 | INDEX RANGE SCAN | GRADITEM_ID | 19 | | | 1 (0)| 00:00:01 |
|* 68 | TABLE ACCESS BY INDEX ROWID | GRADING | 1 | 8 | | 1 (0)| 00:00:01 |
|* 69 | INDEX UNIQUE SCAN | GRADING_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
| 70 | TABLE ACCESS BY INDEX ROWID | CLASS | 1 | 83 | | 1 (0)| 00:00:01 |
|* 71 | INDEX UNIQUE SCAN | CLASS_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
| 72 | TABLE ACCESS BY INDEX ROWID | PRODUCER | 1 | 87 | | 1 (0)| 00:00:01 |
|* 73 | INDEX UNIQUE SCAN | PRODUCER_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
| 74 | TABLE ACCESS BY INDEX ROWID | PATIENT | 1 | 60 | | 1 (0)| 00:00:01 |
|* 75 | INDEX UNIQUE SCAN | PATIENT_PRIMARY | 1 | | | 1 (0)| 00:00:01 |
|* 76 | INDEX RANGE SCAN | USERS_PRODUCER | 1 | | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("QRP"."ProviderID"="U1"."Producer")
5 - access(ROWID=ROWID)
8 - access(TRIM("QRP"."ProviderID")=TRIM("P"."Producer"))
10 - access(TRIM("QRP"."axiUm_Discipline")=TRIM("CLASS"."Class"))
12 - filter("QRP"."ProviderID" IS NOT NULL AND "QRP"."Location"<'9990' AND "QRP"."ProcedureID"<>185 AND
"QRP"."PatientFirstName"<>'NON-PATIENT' AND ("QRP"."PatientFirstName"<>'TED' OR "QRP"."PatientLastName" NOT LIKE
'CAVENDER%'))
13 - filter( NOT EXISTS (SELECT 0 FROM AXIUM."USERS" "USERS" WHERE "Custom3"='YES' AND LNNVL("User"<>:B1)) OR
TO_CHAR(INTERNAL_FUNCTION("P"."EndDate"),'YYYY')<'2011' OR TRIM(TO_CHAR(INTERNAL_FUNCTION("P"."EndDate"),'YYYY')) IS
NULL OR "TRX"."Procedure"='A0021' OR "TRX"."Procedure"='A0022')
14 - access("TRX"."Producer"="U1"."Producer")
16 - access(ROWID=ROWID)
19 - access("PROC"."Discipline"="CLASS"."Class")
21 - access("TRX"."Producer"="P"."Producer")
23 - access("TRX"."Patient"="PAT"."Patient")
25 - access("TRX"."Procedure"="PROC"."Procedure")
26 - filter("PROC"."Discipline" IS NOT NULL)
27 - filter("TRX"."Deleted"=0 AND "TRX"."Status"='C' AND "TRX"."Procedure" NOT LIKE 'D0149%' AND
"TRX"."Procedure"<>'D5001C')
28 - filter("Custom3"='YES' AND LNNVL("User"<>:B1))
33 - access(TRIM(UPPER("GI"."QuestionText"))=TRIM(UPPER("LLU"."GRADITEM_QuestionText")) AND
TRIM(UPPER("GI"."Text"))=TRIM(UPPER("LLU"."GRADITEM_Text")) AND TRIM("TRX"."Procedure")=TRIM("LLU"."ProcedureCode"))
35 - access("TRX"."Type"="GI"."Type" AND "TRX"."Id"="GI"."Id" AND "TRX"."Treatment"="GI"."Treatment")
36 - access("TRX"."Procedure"="PROC"."Procedure")
40 - access("PROC"."Discipline"="CLASS"."Class")
filter("PROC"."Discipline"="CLASS"."Class")
41 - filter("PROC"."Discipline" IS NOT NULL)
42 - filter("TRX"."Grading"<>0 AND "TRX"."Deleted"=0 AND "TRX"."Status"='C')
43 - filter("GI"."Grading"<>0)
45 - access("TRX"."Producer"="P"."Producer")
46 - filter("G"."Deleted"=0)
47 - access("TRX"."Grading"="G"."Grading")
filter("G"."Grading"<>0 AND "G"."Grading"="GI"."Grading")
49 - access("TRX"."Producer"="U1"."Producer")
51 - access("TRX"."Patient"="PAT"."Patient")
61 - filter("GI"."IsHeading"=3 AND TRIM("GI"."QuestionText")='Comments' AND "GI"."Grading"<>0)
62 - filter("TRX"."Grading"<>0 AND "TRX"."Deleted"=0 AND "TRX"."Status"='C' AND ("TRX"."Procedure"='G1002' OR
"TRX"."Procedure"='G1003'))
63 - access("GI"."Type"="TRX"."Type" AND "GI"."Id"="TRX"."Id" AND "GI"."Treatment"="TRX"."Treatment")
64 - filter("TRX"."Grading"<>0 AND "TRX"."Deleted"=0 AND "TRX"."Status"='C' AND ("TRX"."Procedure"='G1002' OR
"TRX"."Procedure"='G1003') AND "TRX"."Grading"="TRX"."Grading")
65 - access("TRX"."Type"="TRX"."Type" AND "TRX"."Id"="TRX"."Id" AND "TRX"."Treatment"="TRX"."Treatment")
66 - filter("GI"."RelValue"<>0 AND "TRX"."Type"="GI"."Type" AND "TRX"."Treatment"="GI"."Treatment")
67 - access("TRX"."Id"="GI"."Id")
68 - filter("G"."Deleted"=0)
69 - access("TRX"."Grading"="G"."Grading")
filter("G"."Grading"<>0 AND "GI"."Grading"="G"."Grading")
71 - access("TRX"."Discipline"="CLASS"."Class")
73 - access("TRX"."Producer"="P"."Producer")
75 - access("TRX"."Patient"="PAT"."Patient")
76 - access("TRX"."Producer"="U1"."Producer")
138 rows selected.
Elapsed: 00:00:00.62
631015 rows selected.
Elapsed: 00:01:49.13Output from AUTOTRACE (I think)
NOTE: this post was too long for the forum, so I have removed a number of lines in the following output which appeared to be duplicating the above section (EXPLAIN PLAN).
Statistics
2657 recursive calls
0 db block gets
12734113 consistent gets
13499 physical reads
0 redo size
103697740 bytes sent via SQL*Net to client
69744 bytes received via SQL*Net from client
6312 SQL*Net roundtrips to/from client
76 sorts (memory)
0 sorts (disk)
631015 rows processedThe TKPROF output
select * from llu_v_production_detail_03
call count cpu elapsed disk query current rows
Parse 1 0.51 0.51 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 6312 88.09 98.01 13490 12733584 0 631015
total 6314 88.60 98.52 13490 12733584 0 631015
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 57
Rows Row Source Operation
631015 VIEW LLU_V_PRODUCTION_DETAIL_03 (cr=12733584 pr=13490 pw=0 time=92145592 us)
631015 UNION-ALL (cr=12733584 pr=13490 pw=0 time=91514573 us)
125485 HASH JOIN (cr=8099 pr=6396 pw=0 time=1523326 us)
1725 VIEW index$_join$_007 (cr=24 pr=0 pw=0 time=4777 us)
1725 HASH JOIN (cr=24 pr=0 pw=0 time=3051 us)
1725 INDEX FAST FULL SCAN USERS_PRIMARY (cr=7 pr=0 pw=0 time=50 us)(object id 55023)
1725 INDEX FAST FULL SCAN USERS_PRODUCER (cr=17 pr=0 pw=0 time=16 us)(object id 55024)
144513 HASH JOIN (cr=8075 pr=6396 pw=0 time=2326445 us)
1396 TABLE ACCESS FULL PRODUCER (cr=107 pr=0 pw=0 time=29 us)
144513 HASH JOIN (cr=7968 pr=6396 pw=0 time=2035684 us)
20 TABLE ACCESS FULL CLASS (cr=7 pr=0 pw=0 time=71 us)
151043 TABLE ACCESS FULL QR_PRODUCTION (cr=7961 pr=6396 pw=0 time=313553 us)
462685 FILTER (cr=10755862 pr=7094 pw=0 time=58570941 us)
466790 HASH JOIN (cr=145247 pr=7094 pw=0 time=11007301 us)
1725 VIEW index$_join$_014 (cr=24 pr=0 pw=0 time=6817 us)
1725 HASH JOIN (cr=24 pr=0 pw=0 time=5091 us)
1725 INDEX FAST FULL SCAN USERS_PRIMARY (cr=7 pr=0 pw=0 time=35 us)(object id 55023)
1725 INDEX FAST FULL SCAN USERS_PRODUCER (cr=17 pr=0 pw=0 time=19 us)(object id 55024)
485205 HASH JOIN (cr=145223 pr=7094 pw=0 time=10945107 us)
20 TABLE ACCESS FULL CLASS (cr=7 pr=0 pw=0 time=105 us)
507772 HASH JOIN (cr=145216 pr=7094 pw=0 time=11947534 us)
1396 TABLE ACCESS FULL PRODUCER (cr=107 pr=0 pw=0 time=18 us)
507772 HASH JOIN (cr=145109 pr=7094 pw=0 time=10924473 us)
188967 TABLE ACCESS FULL PATIENT (cr=31792 pr=0 pw=0 time=188998 us)
507772 HASH JOIN (cr=113317 pr=7094 pw=0 time=9652037 us)
895 TABLE ACCESS FULL PROCEDUR (cr=46 pr=0 pw=0 time=65 us)
509321 TABLE ACCESS FULL TRX (cr=113271 pr=7094 pw=0 time=5604567 us)
8548 TABLE ACCESS FULL USERS (cr=10610615 pr=0 pw=0 time=39053120 us)
42669 NESTED LOOPS (cr=507317 pr=0 pw=0 time=3686506 us)
42669 NESTED LOOPS (cr=421535 pr=0 pw=0 time=3217140 us)
45269 NESTED LOOPS (cr=301155 pr=0 pw=0 time=2449542 us)
45323 NESTED LOOPS (cr=210131 pr=0 pw=0 time=2134056 us)
45323 HASH JOIN (cr=119056 pr=0 pw=0 time=1635472 us)
95 TABLE ACCESS FULL LLU_EVALUATION_DESCRIPTIONS (cr=7 pr=0 pw=0 time=118 us)
98272 HASH JOIN (cr=119049 pr=0 pw=0 time=1446703 us)
46996 HASH JOIN (cr=109018 pr=0 pw=0 time=944857 us)
786 MERGE JOIN (cr=50 pr=0 pw=0 time=1528 us)
20 TABLE ACCESS BY INDEX ROWID CLASS (cr=4 pr=0 pw=0 time=99 us)
20 INDEX FULL SCAN CLASS_PRIMARY (cr=1 pr=0 pw=0 time=10 us)(object id 53850)
786 SORT JOIN (cr=46 pr=0 pw=0 time=750 us)
895 TABLE ACCESS FULL PROCEDUR (cr=46 pr=0 pw=0 time=18 us)
47196 TABLE ACCESS FULL TRX (cr=108968 pr=0 pw=0 time=805137 us)
696300 TABLE ACCESS FULL GRADITEM (cr=10031 pr=0 pw=0 time=277 us)
45323 TABLE ACCESS BY INDEX ROWID PRODUCER (cr=91075 pr=0 pw=0 time=414937 us)
45323 INDEX UNIQUE SCAN PRODUCER_PRIMARY (cr=45752 pr=0 pw=0 time=198709 us)(object id 54581)
45269 TABLE ACCESS BY INDEX ROWID GRADING (cr=91024 pr=0 pw=0 time=353081 us)
45270 INDEX UNIQUE SCAN GRADING_PRIMARY (cr=45753 pr=0 pw=0 time=173185 us)(object id 54088)
42669 TABLE ACCESS BY INDEX ROWID USERS (cr=120380 pr=0 pw=0 time=703786 us)
42669 INDEX RANGE SCAN USERS_PRODUCER (cr=46127 pr=0 pw=0 time=249186 us)(object id 55024)
42669 TABLE ACCESS BY INDEX ROWID PATIENT (cr=85782 pr=0 pw=0 time=407452 us)
42669 INDEX UNIQUE SCAN PATIENT_PRIMARY (cr=43098 pr=0 pw=0 time=198477 us)(object id 54370)
176 TABLE ACCESS BY INDEX ROWID USERS (cr=49426 pr=0 pw=0 time=1783886 us)
367 NESTED LOOPS (cr=49149 pr=0 pw=0 time=6159428 us)
190 NESTED LOOPS (cr=48953 pr=0 pw=0 time=409391 us)
190 NESTED LOOPS (cr=48569 pr=0 pw=0 time=407105 us)
190 NESTED LOOPS (cr=48185 pr=0 pw=0 time=404820 us)
191 NESTED LOOPS (cr=47991 pr=0 pw=0 time=410291 us)
193 NESTED LOOPS (cr=47603 pr=0 pw=0 time=422507 us)
193 NESTED LOOPS (cr=46979 pr=0 pw=0 time=416890 us)
193 NESTED LOOPS (cr=46396 pr=0 pw=0 time=414374 us)
14285 TABLE ACCESS FULL GRADITEM (cr=9602 pr=0 pw=0 time=85793 us)
193 TABLE ACCESS BY INDEX ROWID TRX (cr=36794 pr=0 pw=0 time=128427 us)
8218 INDEX UNIQUE SCAN TRX_PRIMARY (cr=28576 pr=0 pw=0 time=64353 us)(object id 54930)
193 TABLE ACCESS BY INDEX ROWID TRX (cr=583 pr=0 pw=0 time=2169 us)
193 INDEX UNIQUE SCAN TRX_PRIMARY (cr=390 pr=0 pw=0 time=918 us)(object id 54930)
193 TABLE ACCESS BY INDEX ROWID GRADITEM (cr=624 pr=0 pw=0 time=4840 us)
1547 INDEX RANGE SCAN GRADITEM_ID (cr=395 pr=0 pw=0 time=2910 us)(object id 54093)
191 TABLE ACCESS BY INDEX ROWID GRADING (cr=388 pr=0 pw=0 time=1887 us)
191 INDEX UNIQUE SCAN GRADING_PRIMARY (cr=197 pr=0 pw=0 time=943 us)(object id 54088)
190 TABLE ACCESS BY INDEX ROWID CLASS (cr=194 pr=0 pw=0 time=1306 us)
190 INDEX UNIQUE SCAN CLASS_PRIMARY (cr=4 pr=0 pw=0 time=551 us)(object id 53850)
190 TABLE ACCESS BY INDEX ROWID PRODUCER (cr=384 pr=0 pw=0 time=1617 us)
190 INDEX UNIQUE SCAN PRODUCER_PRIMARY (cr=194 pr=0 pw=0 time=715 us)(object id 54581)
190 TABLE ACCESS BY INDEX ROWID PATIENT (cr=384 pr=0 pw=0 time=1941 us)
190 INDEX UNIQUE SCAN PATIENT_PRIMARY (cr=194 pr=0 pw=0 time=939 us)(object id 54370)
176 INDEX RANGE SCAN USERS_PRODUCER (cr=196 pr=0 pw=0 time=1389 us)(object id 55024)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 6312 0.00 0.00
db file scattered read 1614 0.02 2.08
SQL*Net message from client 6312 0.00 10.11
SQL*Net more data to client 48662 0.00 0.70
db file sequential read 4645 0.02 7.11
latch: shared pool 7 0.00 0.00
latch: cache buffers chains 1 0.00 0.00
********************************************************************************Again, I apologize if this is way more information than is necessary.
All advice/suggestions/assistance will be gratefully accepted.
CarlHi Rob,
Thank you for replying. Here is the view definition . . . it looks pretty convoluted, I know.
I am reporting from a database which I have no control over other than to add indexes where needed.
For reporting purposes, I am needing to create the dataset from a number of different tables; hence all the UNION clauses.
-- CODE FOLLOWS
CREATE OR REPLACE VIEW LLU_V_PRODUCTION_DETAIL_03
AS
SELECT
'QR' AS "Source",
U1."User" AS "UserID",
QRP."ProviderID" AS "ProviderID",
P."LastName" AS "ProviderLastName",
P."FirstName" AS "ProviderFirstName",
TO_CHAR(P."EndDate",'YYYY') AS "GraduationYear",
P."PGroup",
QRP."PatientID",
QRP."ChartNumber",
QRP."PatientLastName",
QRP."PatientFirstName",
QRP."ProcedureID" || '-' || QRP."ProcedureSuffix" AS "Procedure",
QRP."ProcedureDescription",
QRP."Tooth" AS "Site",
QRP."Surface",
QRP."axiUm_Discipline" AS "Discipline",
"CLASS"."Rank" AS "DisciplineSorter",
"CLASS"."Name" AS "DisciplineName",
QRP."Points",
0 AS "Hours",
QRP."ServiceDate",
0 AS "Id",
QRP."UniqueID" AS "Grading",
0 AS "LastSort",
QRP."CategoryID",
'' AS "CPAR comments"
FROM QR_PRODUCTION QRP
INNER JOIN PRODUCER P
ON TRIM(QRP."ProviderID") = TRIM(P."Producer")
INNER JOIN CLASS
ON TRIM(QRP."axiUm_Discipline") = TRIM(CLASS."Class")
INNER JOIN USERS U1
ON QRP."ProviderID" = U1."Producer"
WHERE (QRP."Location" < '9990')
AND (QRP."ProviderID" IS NOT NULL)
AND (QRP."ProcedureID" <> 185)
-- skip the Cavender family - training patients
AND NOT (QRP."PatientLastName" LIKE 'CAVENDER%' AND QRP."PatientFirstName" = 'TED')
AND QRP."PatientFirstName" <> 'NON-PATIENT'
--ORDER BY QRP."ProcedureID"
UNION ALL
SELECT
'axiUm TRX' AS "Source",
U1."User" AS "UserID",
TRX."Producer" AS "ProviderID",
P."LastName",
P."FirstName",
TO_CHAR(P."EndDate",'YYYY') AS "GraduationYear",
P."PGroup",
PAT."Patient",
PAT."Chart",
PAT."Last" AS "PatientLastName",
PAT."First" AS "PatientFirstName",
TRX."Procedure",
PROC."Description",
TRX."Site",
TRX."Surface",
TRIM(PROC."Discipline") AS "Discipline",
"CLASS"."Rank" AS "DisciplineSorter",
"CLASS"."Name",
CASE WHEN
((TRX."Procedure" IN ('A0013','A0019','A0020','A0021','A0023','A0024','A0025','A0026','A0027','A0028','A0029','A0030','O179'))
OR
-- no points are to be awarded for any procedures performed on typodonts
(EXISTS (SELECT 1 FROM PTTYPES PTT WHERE PTT."Patient" = PAT."Patient" and PTT."PatType" = 'TYPO' and PTT."Deleted" = 0)))
AND -- except for the following procedures
(TRX."Procedure" NOT IN ('A0015','A0016','A0018','D0210'))
THEN 0 ELSE PROC."RelValue" END AS "Points",
CASE WHEN TRX."Procedure" IN ('A0013','A0019','A0020','A0021','A0023','A0024','A0025','A0026','A0027','A0028','A0029','A0030','O179')
THEN PROC."RelValue" ELSE 0 END AS "Hours",
TRX."TreatmentDate",
TRX."Id",
TRX."Grading",
-1 AS "LastSort",
-- additional link conditions added and table name changed on 1 July 2009 - cji
SELECT "CategoryID" FROM LLU_CATEGORIES_X_PROCEDURES_03 LLU
WHERE TRX."Procedure" = LLU."ProcedureID"
AND TO_CHAR(P."EndDate",'YYYY') = LLU."GraduationYear"
AND SUBSTR(TRX."Producer",1,1) = LLU."ProviderType"
AND LLU."CategoryID" NOT IN (82)
) AS "CategoryID",
'' AS "CPAR comments"
FROM TRX
INNER JOIN PATIENT PAT
ON TRX."Patient" = PAT."Patient"
INNER JOIN USERS U1
ON TRX."Producer" = U1."Producer"
INNER JOIN PROCEDUR PROC
ON TRX."Procedure" = PROC."Procedure"
INNER JOIN CLASS
ON PROC."Discipline" = CLASS."Class"
INNER JOIN PRODUCER P
ON TRX."Producer" = P."Producer"
WHERE (TRX."Status" = 'C')
AND (TRX."Deleted" = 0)
--AND (TRX."Grading" = 0)
AND (TRX."Procedure" NOT LIKE 'D0149%')
AND (TRX."Procedure" <> 'D5001C')
-- exclude all procedures approved by Peds faculty ONLY FOR CLASS OF 2011 AND LATER
-- EXCEPT FOR the Peds Block code (A0021 and A0022) - always include those
AND NOT
TRX."AppUser" IN (SELECT "User" FROM USERS WHERE "Custom3" = 'YES') -- Peds faculty
AND
TO_CHAR(P."EndDate",'YYYY') >= '2011'
AND
TRIM(TO_CHAR(P."EndDate",'YYYY')) IS NOT NULL
AND
TRX."Procedure" NOT IN ('A0021','A0022')
UNION ALL
SELECT
'axiUm GRADING' AS "Source",
U1."User" AS "UserID",
TRX."Producer" AS "ProviderID",
P."LastName",
P."FirstName",
TO_CHAR(P."EndDate",'YYYY'), -- Graduation year
P."PGroup",
PAT."Patient",
PAT."Chart",
PAT."Last" AS "PatientLastName",
PAT."First" AS "PatientFirstName",
TRX."Procedure",
LLU."Description",
TRX."Site",
TRX."Surface",
TRIM(PROC."Discipline") AS "Discipline",
"CLASS"."Rank" AS "DisciplineSorter",
"CLASS"."Name",
LLU."Points", --LLU_POINTS_FROM_EVALUATIONS(TRX."Procedure", nvl(GI."Text",0)),
0 AS "Hours",
TRX."TreatmentDate",
GI."Id",
GI."Grading",
GI."Row" AS "LastSort",
LLU."CategoryID",
'' AS "CPAR comments"
FROM TRX
INNER JOIN PATIENT PAT
ON TRX."Patient" = PAT."Patient"
INNER JOIN PRODUCER P
ON TRX."Producer" = P."Producer"
INNER JOIN GRADING G
ON TRX."Grading" = G."Grading"
INNER JOIN GRADITEM GI
ON G."Grading" = GI."Grading"
AND TRX."Type" = GI."Type"
AND TRX."Id" = GI."Id"
AND TRX."Treatment" = GI."Treatment"
INNER JOIN PROCEDUR PROC
ON TRX."Procedure" = PROC."Procedure"
INNER JOIN CLASS
ON PROC."Discipline" = CLASS."Class"
INNER JOIN LLU_EVALUATION_DESCRIPTIONS LLU
ON (TRIM(UPPER(GI."QuestionText")) = TRIM(UPPER(LLU."GRADITEM_QuestionText")))
AND (TRIM(UPPER(GI."Text")) = TRIM(UPPER(LLU."GRADITEM_Text")))
AND (TRIM(TRX."Procedure") = TRIM(LLU."ProcedureCode"))
INNER JOIN USERS U1
ON TRX."Producer" = U1."Producer"
WHERE (TRX."Status" = 'C')
AND (TRX."Deleted" = 0)
AND (TRX."Grading" <> 0)
AND (G."Deleted" = 0)
UNION ALL
SELECT 'ClinPtsAdj',
U1."User" AS "UserID",
TRX."Producer",
P."LastName", P."FirstName",
TO_CHAR(P."EndDate",'YYYY'), -- Graduation year
P."PGroup", PAT."Patient", PAT."Chart", PAT."Last", PAT."First",
TRX."Procedure",
'Clinic points adjustment',
'' AS "Site",
'' AS "Surface",
TRIM(TRX."Discipline"),
"CLASS"."Rank",
"CLASS"."Name",
DERIVED."Points",
0 AS "Hours",
GI."Date",
GI."Id",
GI."Grading",
GI."Row",
NULL AS "CategoryID",
TRIM(REPLACE(GI."Note", CHR(13) || CHR(10), ' '))
FROM TRX
INNER JOIN PATIENT PAT
ON (TRX."Patient" = PAT."Patient")
INNER JOIN PRODUCER P
ON (TRX."Producer" = P."Producer")
INNER JOIN CLASS
ON (TRX."Discipline" = CLASS."Class")
INNER JOIN GRADING G
ON (TRX."Grading" = G."Grading")
INNER JOIN GRADITEM GI
ON (GI."Grading" = G."Grading")
AND (GI."Type" = TRX."Type")
AND (GI."Id" = TRX."Id")
AND (GI."Treatment" = TRX."Treatment")
INNER JOIN USERS U1
ON TRX."Producer" = U1."Producer"
INNER JOIN
SELECT TRX."Type", TRX."Id", TRX."Treatment", TRX."Grading",
CASE WHEN TRX."Procedure" = 'G1003' THEN GI."RelValue" * -1 ELSE "RelValue" END AS "Points"
FROM TRX, GRADITEM GI
WHERE (TRX."Type" = GI."Type")
AND (TRX."Id" = GI."Id")
AND (TRX."Treatment" = GI."Treatment")
AND (TRX."Procedure" IN ('G1002','G1003'))
AND (TRX."Status" = 'C')
AND (TRX."Deleted" = 0)
AND (TRX."Grading" <> 0)
AND (GI."RelValue" <> 0)
) DERIVED
ON (TRX."Type" = DERIVED."Type")
AND (TRX."Id" = DERIVED."Id")
AND (TRX."Treatment" = DERIVED."Treatment")
AND (TRX."Grading" = DERIVED."Grading")
WHERE (TRX."Status" = 'C')
AND (TRX."Deleted" = 0)
AND (TRX."Grading" <> 0)
AND (G."Deleted" = 0)
AND (TRX."Procedure" IN ('G1002','G1003'))
AND (GI."IsHeading" = 3)
AND (TRIM(GI."QuestionText") = 'Comments')
--ORDER BY "ProviderID", "DisciplineSorter", "Id", "Grading", "Site", "LastSort";A couple of additional points:
The table USERS already had an index on column "Producer"; I added an index on column "Custom3" but it did not seem to make any difference.
Table USERS has 1,725 rows
Table PRODUCER (aliased as P) has 1,396 rows
Table TRX has 1,443,764 rows.
Any additional information you need I will be glad to provide.
Thanks a bunch; it may not be too late to teach an old dog new tricks.
And thank you all for the kind words about the posting; about the only thing I can do well is follow directions.
Carl -
Hi All,
Could you please tell me why this query is taking more time in a package where it is define under a item procedure, but when I not using this in my package which is a outbound taking data from oracle to staging table, this query execute fast and in 40 min I am getting more then 3 lakh+ records in the staging table but when I am include below code it taking more the 12 hours to fatch the records from oracle to staging table. please help how to optimize this query as I have created indexs for all the table.
SELECT distinct substr(TRIM(fds.short_text),instr(fds.short_text,'Rev:',1)+5,instr(fds.short_text,'UOM:',1)-instr(fds.short_text,'Rev:',1)-5)
INTO v_Drawing_Rev
FROM fnd_documents_tl fdt
,FND_DOCUMENTS_SHORT_TEXT fds
,fnd_attached_documents fad
WHERE 1=1
--AND (fdt.MEDIA_ID=14173223)
AND fdt.language = 'US'
AND fdt.MEDIA_ID = fds.MEDIA_ID
AND fad.pk2_value = r_get_data(i).inventory_item_id --to_char(msi.inventory_item_id)
AND fad.pk1_value = (SELECT to_char(organization_id)
FROM org_organization_definitions
WHERE organization_code = 'FLS')
AND fad.document_id = fdt.document_id
AND 'MTL_SYSTEM_ITEMS' = fad.ENTITY_NAME
AND ROWNUM =1;
EXCEPTION
WHEN OTHERS THEN
v_Drawing_Rev := NULL;
END;
}Hi,
Please post the application release along with the database version and OS.
Do you run "Gather Schema Statistics" concurrent program on regular basis?
Please generate the explain plan and post it here -- See the links referenced in this thread for details.
Regarding Performance Tuning
Regarding Performance Tuning
Thanks,
Hussein -
i want to know certain information regarding performance tuning in oracle apps database.wat kind of paerformance tuning activities will the users normally follows in apps database environment.
Hi,
I believe you can find such guidelines in the documents/threads referenced below.
Note: 69565.1 - A Holistic Approach to Performance Tuning Oracle Applications Systems
EBS, performence issue
Re: EBS, performence issue
Oracle Apps Tuning
Re: Oracle Apps Tuning
Regards,
Hussein -
Question Regarding SQL logic error!
Hello everyone,
I get the following error when executing an Informatica mapping with teh following SQL in the Source Qualifier.
error - OR- 00936: missing expression.
Can anyone help please!
SELECT
PS_CUSTOMER.SETID
, PS_CUSTOMER.CUST_ID
, PS_CUSTOMER.CUST_STATUS
, PS_CUSTOMER.ADD_DT
, PS_CUSTOMER.NAME1
, PS_CUSTOMER.TAXPAYER_ID
, PS_CUSTOMER.WEB_URL
, PS_CUSTOMER.LAST_MAINT_OPRID
, PS_CUSTOMER.DATE_LAST_MAINT
, PS_CUST_SIC_CODES.SIC_CD_QUAL
, PS_CUST_SIC_CODES.SIC_CODE
, PS_CUST_CGRP_LNK.CUST_GRP_TYPE
, PS_CUST_CGRP_LNK.CUSTOMER_GROUP
, PS_CUST_CGRP_LNK.LASTUPDDTTM
, PS_CUST_ID_NBRS.STD_ID_NUM
, PS_CUSTOMER.SUBCUST_QUAL1
FROM PS_CUSTOMER
select SIC1.SETID, SIC1.CUST_ID, MAX(SIC1.SIC_CODE) SIC_CODE, SIC1.SIC_CD_QUAL
from PS_CUST_SIC_CODES SIC1
where SIC1.SIC_CD_QUAL =
( select MAX(SIC_CD_QUAL)
from PS_CUST_SIC_CODES SIC2
where SIC2.CUST_ID = SIC1.CUST_ID
and SIC2.SETID = SIC1.SETID
group by SETID, CUST_ID, SIC1.SIC_CD_QUAL
) PS_CUST_SIC_CODES
select A.CUST_ID, A.SETID, A.CUST_GRP_TYPE
, MAX(A.CUSTOMER_GROUP) CUSTOMER_GROUP, A.LASTUPDDTTM
from PS_CUST_CGRP_LNK A
where A.CUST_GRP_TYPE =
SELECT MAX(CUST_GRP_TYPE)
FROM PS_CUST_CGRP_LNK B
WHERE A.CUST_ID = B.CUST_ID
AND A.SETID = B.SETID
AND A.LASTUPDDTTM = B.LASTUPDDTTM
AND B.LASTUPDDTTM =
SELECT MAX(LASTUPDDTTM)
FROM PS_CUST_CGRP_LNK C
WHERE C.CUST_ID = B.CUST_ID
AND C.SETID = B.SETID
GROUP BY CUST_ID, SETID, CUST_GRP_TYPE, LASTUPDDTTM
) PS_CUST_CGRP_LNK
select SETID, CUST_ID, STD_ID_NUM
from PS_CUST_ID_NBRS
where STD_ID_NUM_QUAL = 'DNS'
) PS_CUST_ID_NBRS
WHERE
{ PS_CUSTOMER
LEFT OUTER JOIN
PS_CUST_SIC_CODES ON
PS_CUSTOMER.SETID = PS_CUST_SIC_CODES.SETID
AND PS_CUSTOMER.CUST_ID = PS_CUST_SIC_CODES.CUST_ID
LEFT OUTER JOIN
PS_CUST_CGRP_LNK ON
PS_CUSTOMER.SETID = PS_CUST_CGRP_LNK.SETID
AND PS_CUSTOMER.CUST_ID = PS_CUST_CGRP_LNK.CUST_ID
LEFT OUTER JOIN
PS_CUST_ID_NBRS ON
PS_CUSTOMER.SETID = PS_CUST_ID_NBRS.SETID
AND PS_CUSTOMER.CUST_ID = PS_CUST_ID_NBRS.CUST_ID
ORDER BY PS_CUSTOMER.CUST_ID , PS_CUSTOMER.SETID
Thanks,
Ajay.Kramer wrote:
Hi
So.. do we have to pay for the feature regarding sql tuning advisor?
Can we use the dbms_sqltune package for free in oracle?
No, you need the license. Please read below,
http://download.oracle.com/docs/cd/E11882_01/license.112/e10594/options.htm#CIHFIHFG
I `m doing below test on my Linux. I installed an oracle on it and only for study purpose so didn`t pay.
As you can see. I got no output.
SQL> exec dbms_sqltune.execute_tuning_task('TASK_1634');
PL/SQL procedure successfully completed.
SQL> select dbms_sqltune.report_tuning_task('TASK_1634') from dual;
DBMS_SQLTUNE.REPORT_TUNING_TASK('TASK_1634')
GENERAL INFORMATION SECTION
Please read the below link to learn how to use the STA.
http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/sql_tune.htm
HTH
Aman.... -
Where to find best practices for tuning data warehouse ETL queries?
Hi Everybody,
Where can I find some good educational material on tuning ETL procedures for a data warehouse environment? Everything I've found on the web regarding query tuning seems to be geared only toward OLTP systems. (For example, most of our ETL
queries don't use a WHERE statement, so the vast majority of searches are table scans and index scans, whereas most index tuning sites are striving for index seeks.)
I have read Microsoft's "Best Practices for Data Warehousing with SQL Server 2008R2," but I was only able to glean a few helpful hints that don't also apply to OLTP systems:
often better to recompile stored procedure query plans in order to eliminate variances introduced by parameter sniffing (i.e., better to use the right plan than to save a few seconds and use a cached plan SOMETIMES);
partition tables that are larger than 50 GB;
use minimal logging to load data precisely where you want it as fast as possible;
often better to disable non-clustered indexes before inserting a large number of rows and then rebuild them immdiately afterward (sometimes even for clustered indexes, but test first);
rebuild statistics after every load of a table.
But I still feel like I'm missing some very crucial concepts for performant ETL development.
BTW, our office uses SSIS, but only as a glorified stored procedure execution manager, so I'm not looking for SSIS ETL best practices. Except for a few packages that pull from source systems, the majority of our SSIS packages consist of numerous "Execute
SQL" tasks.
Thanks, and any best practices you could include here would be greatly appreciated.
-EricOnline ETL Solutions are really one of the biggest challenging solutions and to do that efficiently , you can read my blogs for online DWH solutions to know at the end how you can configure online DWH Solution for ETL using Merge command of SQL Server
2008 and also to know some important concepts related to any DWH solutions such as indexing , de-normalization..etc
http://www.sqlserver-performance-tuning.com/apps/blog/show/12927061-data-warehousing-workshop-1-4-
http://www.sqlserver-performance-tuning.com/apps/blog/show/12927103-data-warehousing-workshop-2-4-
http://www.sqlserver-performance-tuning.com/apps/blog/show/12927173-data-warehousing-workshop-3-4-
http://www.sqlserver-performance-tuning.com/apps/blog/show/12927061-data-warehousing-workshop-1-4-
Kindly let me know if any further help is needed
Shehap (DB Consultant/DB Architect) Think More deeply of DB Stress Stabilities -
Code for Embedding Quicktime Movies in Web Pages-Question
I have been embedding QT movies in web pages for years. I used to use the embed and object tags, but due to the problems with the default settings of IE7, in regards to ActiveX, I recently changed to the javascript method.
I will paste sample code below, of how I use it, with the movie title change to sample: (of course I change the dimensions, depending on the movie size.)
<script language="JavaScript" type="text/javascript"><!--
QT_WriteOBJECT('sample.mov', '644', '76','','controller','true','autoplay','true','showlogo','true','cache','false' ,'enablejavascript','true');
// --></script>
and I put at the top of the page, right before </head>
<script src="AC_QuickTime.js" language="JavaScript" type="text/javascript"></script>
I forgot where I got this code. Perhaps from someone on this forum, or elsewhere. It seems to work with the default settings on most browsers.
I have a couple questions, however, regarding fine-tuning it a little more.
1) If it takes a while for the movie to load, users who open my pages see a static Q QT icon. How would one make the icon flash, with flashing text that says "Loading", so that the user knows that the video is loading? (I have seen that on other sites, and don't know how to do that.)
2)As said the javascript works with most browser default settings, as most have javascript enabled by default. But what if a user does not have javascript enabled? Could the code sense that, and if non-existent, tell the user to enable javascript? Or, if javascript is disabled, could the embed and/or object tags be activated?
3) The code above, that I got from someone, says "cache=false". That means that each time someone sees the movie, it has to be reloaded from the net, and not from the browser cache, correct? If so, why would one want it to be set that way? If it's a large movie, a user with a slower computer and/or internet connection would certainly prefer if it could play from the cache the next time, loading much faster. Is there any reason to prefer "cache=false"?
4)Is there any code that could be put in, to allow the user, if they prefer, to download the file,(perhaps with a right-click or CTRL-Click), instead of playing it in the browser?
Thank you very much in advance, to whomever can help with these code questions.Thank you for your reply, Kirk,
1)Yes, I do have "fast start" enabled in my files, and they were made with QT Pro, newest version. So no, there is no "trouble with my files".
However, I would still like to have that flashing "Loading" icon when the file is loading, as I see on other sites. (And yes, even with "Fast Start" enabled, depending on the size of the file, the speed of the computer and internet connection, it can take a little time beforeit starts.) Anyone know how to create that flashing "Loading" icon, rather than just the static Q?
2)I just wondered if there was a way for the javascript to recognize if the user does not have javascript, and bring up a message if that is the case, telling the user they need to enable it to see the content. (As would happen if the user does not have the QT plugin installed.) Yes, I realize it would not work to include in the normal way the embed and object tags as well, I wondered if there was a way to invoke them only if the user doesn't have javascript. Perhaps impossible, but I thought I'd ask, in case someone knows of a way to do that.
4)Yes, I guess I could just put a separate direct text link to the movie file for downloading. I just wondered if there was a way to put that in the javascript, so that if someone right-clicks on the QT icon, they can download rather than view it, rather than use a separate link. That may also be impossible, but I thought I'd ask, and see if there is a way to do that.
Your question to me regarding dimensions--I forget which was the QT movie, that I took that sample from. Yes, I have some in unusual sizes. They are not normal movies. I don't have time to explain more now though, and that has no bearing on the questions I asked.
Once again, thanks for replying, and if you or someone else could help further with my questions, I would appreciate it very much.
Have a nice day! -
How to determine bottleneck node in Oracle EBS
Hi all,
I am currently working on Oracle EBS auditing and performance tuning project. After assessment phase, I am going to give a proposal about how to improve performance of entire systems to my senior manager.
But it is the first time I work on this kind of project. So, please share me some experience to assess, determine which node is running in high load, the bottleneck of system (web node, concurrent node, form node,...). It will be better if share me some material (guide, checklist or methodology).
Thanks,Hi;
Similar topics discussed here before.Please chek:
EBS-Application security
Re: Oracle Applications Security
E-business Performance issuse
Re: E-business Performance issuse
Regarding Performance Tuning
Regarding Performance Tuning
Audit-EBS
Re: How to setup audit trail for some of our tables
I belive you can follow note&steps&advice in upper links
Hope it helps
Regard
Helios -
Can this query be optimised?
Hi,
This query is taking more time to execute. please can someone advise..
SELECT reference_value AS billing_system_account_id,
account_id AS sim_account_id
FROM account_reference
WHERE reference_name = 'ACCOUNT_ID'
AND account_id IN
(SELECT DISTINCT (ACCOUNT_ID)
FROM asset
WHERE status NOT IN ('CEASED', 'CANCELLED')
AND asset_id IN
(SELECT asset_id
FROM asset_config
WHERE config_name IN
('userName', 'login')
AND (config_value IN
('abc'
|| '@abc',
'abc'))))Using EXISTS instead of IN, as Salim suggested, might work for you.
Some more explanation:
http://asktom.oracle.com/pls/asktom/f?p=100:11:2095243262787694::::P11_QUESTION_ID:953229842074
But anyway:
when posting a tuning request, you always need to mention:
- your database version
- an execution plan of the query (or tkprof output)
- information regarding indexes
- information regarding table statistics
in order to make it possible for us to help you better.
Please read these informative threads regarding posting tuning requests:
When your query takes too long ...
HOW TO: Post a SQL statement tuning request - template posting
Maybe you are looking for
-
Want to Fix iPhone 5 Battery Drain? (A Workaround)
iPhone 5 (US - AT&T GSM - MD634LL) iOS 6.0.2 (10A551) Note: What I will detail/propose below is the implementation of a workaround to make do with what we have until Apple provides the solution. The hard truth to swallow for loyal Apple customers and
-
Update 1 column,1 single table based on where results of multiple tables
I would like the my_id column in 1 table updated to the static value of 247 for my_id stored in the 1 single table based on the where clause, which uses the my_id column in it. The update statement updates all rows in table1, instead of just the rows
-
CALL FUNCTION 'POSTING_INTERFACE_CLEARING'
请问怎么输入清帐凭证的金额 REPORT ZTETS1 . CALL FUNCTION 'POSTING_INTERFACE_START' EXPORTING I_CLIENT = SY-MANDT I_FUNCTION = 'D' i_group = space i_holddate = space i_keep
-
Option to select RoboHelp settings.ISF file missing in FM12
Hi I am not sure if this query comes under FrameMaker forum or RoboHelp, but since I did not see RH Integration category in FrameMaker forums, I am posting it here. Moderators, please move it to the right forum or let me know if I have to delete it f
-
Bei aktalisierung erfolgt das download, nach ende Download kommt Fehlermeldung fehler beim Download (Installation nicht möglich, Versuchen Sie es später noch einmal. Kennt jemand das Problem, was kann ich tun? Harald Bässle Emailaddresse: [email prot