Performance Problem While Selecting a Query....
Hi Users
I have problem with performance with appliction
where are using D2K frent end and backend oracle 9i
we have a validaion buttion that is taking lot of time to check the date like 500 records
i want some links about performance issue process pls help.
Here some of the query taking more than 1sec to more
1)
SELECT
/*+(INDEX(KBS_CHKSHTCARDTB(IND1_CHKSHTCARD))*/
COUNT(DISTINCT A.KBCK_CHKSHEET_NO)
FROM
KBS_CHKSHTCARDTB A ,KBS_CHKSHTHDRTB B WHERE A.KBCK_CHKSHEET_NO=B.KBCH_CHKSHEET_NO
AND KBCK_E_DATE =TRUNC(SYSDATE)
AND KBCH_PRINT_STATUS='P'
OutPut: 206
Time : 1sec
2)
UPDATE KBS_CARDMASTERTB
SET KBCM_LOCK_FROM = KBCM_LOCK_FROM_CONTROL,
KBCM_LOCK_STATUS= NULL
WHERE KBCM_LOCK_FROM_CONTROL is not null
and KBCM_LOCK_FROM IS NULL
and KBCM_LOCK_FROM_CONTROL <=trunc(sysdate)
AND KBCM_LOCK_STATUS = 'Y'
and KBCM_UNIQUE_IDNO IN(SELECT DISTINCT KBSA_UNIQUE_IDNO
FROM KBS_SCANTB WHERE TRUNC(KBSA_E_DATE) = TRUNC(:KANBAN_CTRL_BLK.DAT)
AND KBSA_TRUCK_SQ_NO = :Kanban_ctrl_blk.cycl
AND KBSA_ERROR_CODE IS NULL)
AND (KBCM_VENDOR_NO,KBCM_PLANT_CODE)in (SELECT DISTINCT kbsa_vendor_no,KBSA_PLANT_CODE
FROM KBS_SCANTB WHERE TRUNC(KBSA_E_DATE) = TRUNC(:KANBAN_CTRL_BLK.DAT) AND KBSA_TRUCK_SQ_NO = :Kanban_ctrl_blk.cycl AND KBSA_ERROR_CODE IS NULL)
AND KBCM_PROCESS_CODE IN (SELECT DISTINCT KBSA_PROCESS_CODE
FROM KBS_SCANTB WHERE TRUNC(KBSA_E_DATE) = TRUNC(:KANBAN_CTRL_BLK.DAT) AND KBSA_TRUCK_SQ_NO = :Kanban_ctrl_blk.cycl
AND KBSA_ERROR_CODE IS NULL);
OutPut: Totatl Number of Table:29288
Time : more than 5sec
3)
CURSOR GET_TEMP_CARDS_SWIPED_CUR IS
SELECT KBCM_VENDOR_NO
,KBCM_PLANT_CODE
,KBCM_FAMILY --ADDED BY SUJITH.C TO SUPPORT PSMS2
,KBCM_BACK_NO
,KBCM_UNIQUE_IDNO
,KBCM_KANBAN_TYPE
FROM KBS_CARDMASTERTB
WHERE KBCM_KANBAN_TYPE IN ('T','B')
AND KBCM_UNIQUE_IDNO IN
(SELECT KBSA_UNIQUE_IDNO
FROM KBS_SCANTB
WHERE KBSA_E_DATE = :DAT
AND KBSA_TRUCK_SQ_NO = :CYCL
AND KBSA_ERROR_CODE IS NULL
AND KBSA_TYPE IS NULL);
Thanks Advance ........
[When your query takes too long...|http://forums.oracle.com/forums/thread.jspa?messageID=1812597#1812597]
[How to post a SQL statement tuning request|http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0]
Similar Messages
-
Performance problem with selecting records from BSEG and KONV
Hi,
I am having performance problem while selecting records from BSEG and KONV table. As these two tables have large amount of data , they are taking lot of time . Can anyone help me in improving the performance . Thanks in advance .
Regards,
PrashantHi,
Some steps to improve performance
SOME STEPS USED TO IMPROVE UR PERFORMANCE:
1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
5. Avoid using nested SELECT statement SELECT within LOOPs.
6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
7. Avoid using SELECT * and Select only the required fields from the table.
8. Avoid nested loops when working with large internal tables.
9. Use assign instead of into in LOOPs for table types with large work areas
10. When in doubt call transaction SE30 and use the examples and check your code
11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
12. Use "CHECK" instead of IF/ENDIF whenever possible.
13. Use "CASE" instead of IF/ENDIF whenever possible.
14. Use "MOVE" with individual variable/field moves instead of "MOVE-
CORRESPONDING" creates more coding but is more effcient. -
Problem while selecting BELNR from BSEG
Hi Experts,
I have a report performance problem while fetching BELNR from BSEG table.
I have to print latest BELNR from BSEG where BUZID = M but at the time of execution of report, It is taking too much time (More that hour and sometimes it gets hanged).
I have also gone through the comments provided by experts for previous problems asked in this forum e.g. BSEG is a cluster table that is why data retrieval takes long time etc.
Can any one has any other idea or suggestion or any other way to solve this problem
Regards,
NeerajHi,
1) Try to create an index on BUZID field
2) Don't use SELECT/ENDSELECT statement. Instead of that extract all the concerned entries from BSEG into an internal table :
select belnr from bseg appending table itab where buzid = 'M'.
then do this :
sort itab by belnr.
describe itab lines n.
read table itab index n.
Please reward if helpful.
Regards,
Nicolas. -
Problem while opening Bex query on the web
Hello BW experts,
I have a problem while opening Bex query from my SAP Favorites.See below.
When i double click on the query, i get the following page, with the server name KBWS01QX.
But, from RSRT Tcode, select the query > query display as HTML > Click on ABAP Web , click execute as shown below, it is going to the correct URL as in the 2nd screen shot below.
My question is why is it going to the wrong URL when i open it from SAP Favorites menu?
I want it to open the same URL as it opened from RSRT(which is the right one)
What is the Config needed to make it to work from SAP favorites.
Any help would be appreciated.
Thanks alot.
SVHello,
Thank you all for your responses.
See below some additional info.
From RSRT, this time I clicked on JAVA WEB, and i get the below URL, which is the same URL i was getting when i executed the query from SAP favorites.
http://kbws01qx.xxxxxxx.com:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=ZCONSUMPTION
Also, i have executed the Function module : RSBB_URL_PREFIX_GET and i get the below values.
It seems that it is trying to connect to Java portal something services may be, but i want it to open in ABAP web only.
Please help. -
Performance Problem while Aggregation
Performance problem while aggrgating
These r my dimension and cube i wrote customized Aggrgation map and i m aggragating all dimension (except for last level a unique one (PK) + cube .
My system config is good ..
But Aggrgation deployment (calculation ) is really really very slow compared to other vendors product
i.e. It took me 3 hours to aggrgate all dimension (all levels except last) and cube (only containing 1000 rows to check and deleted all others rows)
Dimensions Number of rows
dim_product 156,0
t_time 730
dim_promotion 186,4
dim_store 25
dim_distributor 102,81
Cube Number of Row
Cube_SalesFact 300,000
Plz solve my problem coz if it take that much time then i must say the performance of software is not that good where it should be....
and i must suggest oracle to do some thing about this serious problem
Thanks
Well wisher of Oracle CorporationBEGIN
cwm2_olap_manager.set_echo_on;
CWM2_OLAP_MANAGER.BEGIN_LOG('D:\', 'AggMap_CubeSalesfact.log');
DBMS_AW.EXECUTE('aw attach RTTARGET.AW_WH_SALES RW' );
BEGIN
DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_DISTRIBUTOR', 'RTTARGET', 'DIM_DISTRIBUTOR');
DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_PRODUCT', 'RTTARGET', 'DIM_PRODUCT');
DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_PROMOTION', 'RTTARGET', 'DIM_PROMOTION');
DBMS_AWM.DELETE_AWDIMLOAD_SPEC('DIM_STORE', 'RTTARGET', 'DIM_STORE');
DBMS_AWM.DELETE_AWDIMLOAD_SPEC('T_TIME', 'RTTARGET', 'T_TIME');
--Deleting AW_CubeLoad_Spec
DBMS_AWM.DELETE_AWCUBELOAD_SPEC('CUBESALESFACT', 'RTTARGET', 'CUBE_SALESFACT');
DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
Commit;
--Deleting AggMap
DBMS_AWM.Delete_AWCUBEAGG_SPEC('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT');
DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
Commit;
EXCEPTION WHEN OTHERS THEN NULL;
END;
--Creating Agg Map for cube cube_salesfact
-- DBMS_AWM.CREATE_AWCUBEAGG_SPEC(AggMap_Name , USER , AW_NAME, CUBE_NAME);
DBMS_AWM.CREATE_AWCUBEAGG_SPEC('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT');
--Specifying aggrgation for measures of cube
DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'STORECOST');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'STORESALES');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_MEASURE('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'UNITSALES');
--Specifying aggrgation for different level of dimensions
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_ALLYEARS');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_YEAR');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_QUARTER');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_T_TIME', 'L_MONTH');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_ALLCOUNTRIES');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_COUNTRY');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_PROVINCE');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_STORE', 'L_CITY');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_ALLPRODUCTS');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRANDCLASS');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRANDCATEGORY');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PRODUCT', 'L_BRAND');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_DISTRIBUTOR', 'L_ALLDIST');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_DISTRIBUTOR', 'L_DISTINCOME');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PROMOTION', 'L_ALLPROM');
DBMS_AWM.ADD_AWCUBEAGG_SPEC_LEVEL('AGG_CUBESALESFACT', 'RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'WH_DIM_PROMOTION', 'L_PROMOTIONMEDIA');
Begin
--************************ CODE **********************************
--aw_dim.sql
DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_DISTRIBUTOR', 'RTTARGET', 'DIM_DISTRIBUTOR', 'FULL_LOAD_ADDITIONS_ONLY');
DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_DISTRIBUTOR', 'DIM_DISTRIBUTOR');
commit;
DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_PRODUCT', 'RTTARGET', 'DIM_PRODUCT', 'FULL_LOAD_ADDITIONS_ONLY');
DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_PRODUCT', 'DIM_PRODUCT');
commit;
DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_PROMOTION', 'RTTARGET', 'DIM_PROMOTION', 'FULL_LOAD_ADDITIONS_ONLY');
DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_PROMOTION', 'DIM_PROMOTION');
commit;
DBMS_AWM.CREATE_AWDIMLOAD_SPEC('DIM_STORE', 'RTTARGET', 'DIM_STORE', 'FULL_LOAD_ADDITIONS_ONLY');
DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_DIM_STORE', 'DIM_STORE');
commit;
DBMS_AWM.CREATE_AWDIMLOAD_SPEC('T_TIME', 'RTTARGET', 'T_TIME', 'FULL_LOAD_ADDITIONS_ONLY');
DBMS_AWM.REFRESH_AWDIMENSION('RTTARGET', 'AW_WH_SALES', 'WH_T_TIME', 'T_TIME');
commit;
--aw_cube.sql
DBMS_AWM.CREATE_AWCUBELOAD_SPEC('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'LOAD_DATA');
dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'STORECOST', 'STORECOST', 'STORECOST');
dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'STORESALES', 'STORESALES', 'STORESALES');
dbms_awm.add_awcubeload_spec_measure('CUBE_SALESFACT', 'RTTARGET', 'CUBE_SALESFACT', 'UNITSALES', 'UNITSALES', 'UNITSALES');
DBMS_AWM.REFRESH_AWCUBE('RTTARGET', 'AW_WH_SALES', 'WH_CUBE_SALESFACT', 'CUBE_SALESFACT');
EXCEPTION WHEN OTHERS THEN NULL;
END;
-- Now build the cube. This may take some time on large cubes.
-- DBMS_AWM.aggregate_awcube(USER, AW_NAME, CUBE_NAME, aggspec);
DBMS_AWM.aggregate_awcube('RTTARGET','AW_WH_SALES', 'WH_CUBE_SALESFACT','AGG_CUBESALESFACT');
DBMS_AW.EXECUTE('upd '||'RTTARGET'||'.'||'AW_WH_SALES' ||'; commit');
Commit;
CWM2_OLAP_METADATA_REFRESH.MR_REFRESH();
CWM2_OLAP_METADATA_REFRESH.MR_AC_REFRESH();
DBMS_AW.Execute('aw detach RTTARGET.AW_WH_Sales');
CWM2_OLAP_MANAGER.END_LOG;
cwm2_olap_manager.set_echo_off;
EXCEPTION WHEN OTHERS THEN NULL;
-- EXCEPTION WHEN OTHERS THEN RAISE;
END; -
Strange problem while execution of query....
Hi Friends
I am facing a strange problem while executing the query.
I have one query ,its old one ,till yesterday everday it was working fine ,
But today i am trying to execute that query ,execution process takes very long time ,finally no response from bw server.
its an important report in our company
I checked query , Every thing is ok ,bze i haven't made any changes
So i need some suggetions .like where can i check and what can i do?
ASAP .... So Please ...its very urgent....
EVERY THING AND ANY THING WILL BE REWARED
Thanks in advance
RKHi
Stefan
Thank you for your valuable suggestion
the problem is solved
Already i assigned points.
Thnaks & Regards
RK -
Performance Problem While Data updating In Customize TMS System
Dear guys
I have developed Customize time management system,but there is performance problem while updating machine date in monthly roster table,there is if else condition,which check record status either is late or Present on time etc.
have any clue to improve performance.
Thanks in advance
--regard
furqanFurqan wrote:
Dear guys
I have developed Customize time management system,but there is performance problem while updating machine date in monthly roster table,there is if else condition,which check record status either is late or Present on time etc.
have any clue to improve performance.From that description and without any database version, code, explain plans, execution traces or anything that would be remotely useful.... erm... No.
Hint:-
How to Post an SQL statement tuning request...
HOW TO: Post a SQL statement tuning request - template posting -
Performance Problem in Select query
Hi,
I have performance Problem in following Select Query :
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO CORRESPONDING FIELDS OF TABLE GT_LIPS
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
as per trace i have analysed that it is fetch the complete table scan from the LIPS table and table contants almost 3 lakh records.
Kindly Suggest what we can do to optimize this query.
Regards,
Harshtypes: begin of line,
vbeln type lips-vbeln
posnr type lips-posnr
lfimg type lips-lfimg
vrkme type lips-vrkme
vgbel type lips- vgbel
vgpos type lips-vgpos
end of line.
data: itab type standard table of line,
wa type line.
IF GT_EKPO1[] IS NOT INITIAL.
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO TABLE ITAB
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
ENDIF. -
Performance problem whlile selecting(extracting the data)
i have one intermediate table.
iam inserting the rows which are derived from a select statement
The select statement having a where clause which joins a view (created by 5 tables)
The problem is select statement which is getting the data is taking more time
i identified the problems like this
1) The view which is using in the select statement is not indexed---is index is necessary on view ????
2) Because the tables which are used to create a view have already properly indexed
3) while extracting the data it is taking the more time
the below query will extract the data and insert the data in the intermediate table
SELECT 1414 report_time,
2 dt_q,
1 hirearchy_no_q,
p.unique_security_c,
p.source_code_c,
p.customer_specific_security_c user_security_c,
p.par_value par_value, exchange_code_c,
(CASE WHEN p.ASK_PRICE_L IS NOT NULL THEN 1
WHEN p.BID_PRICE_L IS NOT NULL THEN 1
WHEN p.STRIKE_PRICE_L IS NOT NULL THEN 1
WHEN p.VALUATION_PRICE_L IS NOT NULL THEN 1 ELSE 0 END) bill_status,
p.CLASS_C AS CLASS,
p.SUBCLASS_C AS SUBCLASS,
p.AGENT_ADDRESS_LINE1_T AS AGENTADDRESSLINE1,
p.AGENT_ADDRESS_LINE2_T AS AGENTADDRESSLINE2,
p.AGENT_CODE1_T AS AGENTCODE1,
p.AGENT_CODE2_T AS AGENTCODE2,
p.AGENT_NAME_LINE1_T AS AGENTNAMELINE1,
p.AGENT_NAME_LINE2_T AS AGENTNAMELINE2,
p.ASK_PRICE_L AS ASKPRICE,
p.ASK_PRICE_DATE_D AS ASKPRICEDATE,
p.ASSET_CLASS_T AS ASSETCLASS
FROM (SELECT
DISTINCT x.*,m.customer_specific_security_c,m.par_value
FROM
HOLDING_M m JOIN ED_DVTKQS_V x ON
m.unique_security_c = x.unique_security_c AND
m.customer_c = 'CONF100005' AND
m.portfolio_c = 24 AND
m.status_c = 1
WHERE exists
(SELECT 1 FROM ED_DVTKQS_V y
WHERE x.unique_security_c = y.unique_security_c
GROUP BY y.unique_security_c
HAVING MAX(y.trading_volume_l) = x.trading_volume_l)) p
any one please give me the valueble suggestions on the performancethanks for the updating
in the select query we used some functions like max
(SELECT 1 FROM ED_DVTKQS_V y
WHERE x.unique_security_c = y.unique_security_c
GROUP BY y.unique_security_c
HAVING MAX(y.trading_volume_l) = x.trading_volume_l)) p
will these type of functions will cause the performance problem ??? -
Performance issue while selecting material documents MKPF & MSEG
Hello,
I'm facing performance issues in production while selecting Material documents for Sales order and item based on the Sales order Stock.
Here is the query :
I'm first selecting data from ebew table which is the Sales order Stock table then this query.
IF ibew[] IS NOT INITIAL AND ignore_material_documents IS INITIAL.
* Select the Material documents created for the the sales orders.
SELECT mkpf~mblnr mkpf~budat
mseg~matnr mseg~mat_kdauf mseg~mat_kdpos mseg~shkzg
mseg~dmbtr mseg~menge
INTO CORRESPONDING FIELDS OF TABLE i_mseg
FROM mkpf INNER JOIN mseg
ON mkpf~mandt = mseg~mandt
AND mkpf~mblnr = mseg~mblnr
AND mkpf~mjahr = mseg~mjahr
FOR ALL entries IN ibew
WHERE mseg~matnr = ibew-matnr
AND mseg~werks = ibew-bwkey
AND mseg~mat_kdauf = ibew-vbeln
AND mseg~mat_kdpos = ibew-posnr.
SORT i_mseg BY mat_kdauf ASCENDING
mat_kdpos ASCENDING
budat DESCENDING.
ENDIF.
I need to select the material documents because the end users want to see the stock as on certain date for the sales orders and only material document lines can give this information. Also EBEW table gives Stock only for current date.
For Example :
If the report was run for Stock date 30th Sept 2008, but on the 5th Oct 2008, then I need to consider the goods movements after 30th Sept and add if stock was issued or subtract if stock was added.
I know there is an Index MSEG~M in database system on mseg, however I don't know the Storage location LGORT and Movement types BWART that should be considered, so I tried to use all the Storage locations and Movement types available in the system, but this caused the query to run even slower than before.
I could create an index for the fields mentioned in where clause , but it would be an overhead anyways.
Your help will be appreciated. Thanks in advance
regards,
AdvaitHi Thomas,
Thanks for your reply. the performance of the query has significantly improved than before after switching the join from mseg join mkpf.
Actually, I even tried without join and looped using field symbols ,this is working slightly faster than the switched join.
Here are the result , tried with 371 records as our sandbox doesn't have too many entries unfortunately ,
Results before switching the join 146036 microseconds
Results after swithing the join 38029 microseconds
Results w/o join 28068 microseconds for selection and 5725 microseconds for looping
Thanks again.
regards,
Advait -
Problem while running BEx Query
Hi All,
I had reqiurement of calculating the difference of the two dates.I calculated Date Difference but I am getting problem when I run the Query.
The problem is " I am finding the difference between Schedule Line Date and Posting Date. There are some blank spaces in the cube over Schedule Line Date and also over Posting Date. While running the Query Blank Space is taken as # symbol and while calculating the differences it is giving the differences in Lakhs."
Can anybody help me to solve the problem " To remove the # symbol and calculate the differences properly".
Thanks in advance.
With Regards
MahiHi,
Use the Boolean concept like below:
I hope you are using formula varibles to get Dates into the formula.
Lets assume fv1 is formulavarible on Schedule line date and FV2 is Formula varible on Posting date.
(FV1 == '' OR FV2 == '') * 0 + (FV1 <> '' AND FV2 <> '') * (FV1-FV2).
With rgds,
Anil Kumar Sharma .P -
Performance problem in select data from data base
hello all,
could you please suggest me which select statement is good for fetch data form data base if data base contain more than 10 lac records.
i am using SELECT PACKAGE SIZE n statement, but it's taking lot of time .
with best regards
srinivas rathodHi Srinivas,
if you have huge data and selecting ,you could decrease little bit time if you use better techniques.
I do not think SELECT PACKAGE SIZE will give good performance
see the below examples :
ABAP Code Samples for Simple Performance Tuning Techniques
1. Query including select and sorting functionality
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on
fmatnr = gmatnr where gstlal = '01' order by fernam.
Code B
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01'.
sort itab_new by ernam.
Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: The Order by clause associated with a select statement increases the execution time of the statement, so it is profitable to sort the internal table once after selecting the data.
2. Performance Improvement Due to Identical Statements Execution Plan
Consider the below queries and their levels of efficiencies is saving the execution
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
sort itab_new.
select fmatnr fernam
fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as
f inner join mast as g on f~matnr =
gmatnr where gstlal
= '01' .
Code D (Identical Select Statements)
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
sort itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: Each SQL statement during the process of execution is converted into a series of database operation phases. In the second phase of conversion (Prepare phase) an execution plan is determined for the current SQL statement and it is stored, if in the program any identical select statement is used, then the same execution plan is reused to save time. So retain the structure of the select statement as the same when it is used more than once in the program.
3. Reducing Parse Time Using Aliasing
A statement which does not have a cached execution plan should be parsed before execution; this parsing phase is a highly time and resource consuming, so parsing time for any sql query must include an alias name in it for the following reason.
1. Providing the alias name will enable the query engine to resolve the tables to which the specified fields belong to.
2. Providing a short alias name, (a single character alias name) is more efficient that providing a big alias name.
Code E
select jmatnr jernam jmtart jmatkl
gwerks gaenam g~stlal into table itab_new from mara as
j inner join mast as g on jmatnr = gmatnr where
g~stlal = '01' .
In the above code the alias name used is j .
4. Performance Tuning Using Order by Clause
If in a SQL query you are going to read a particular database record based on some key values mentioned in the select statement, then the read query can be very well optimized by ordering the fields in the same order in which we are going to read them in the read query.
Code F
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
end of itab_new.
select MATNR ERNAM MTART MATKL from mara into table itab_new where
MTART = 'HAWA' ORDER BY MATNR ERNAM MTART MATKL.
read table itab_new with key MATNR = 'PAINT1' ERNAM = 'RAMANUM'
MTART = 'HAWA' MATKL = 'OFFICE'.
Code G
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
end of itab_new.
select MATNR ERNAM MTART MATKL from mara into table itab_new where
MTART = 'HAWA' ORDER BY ERNAM MATKL MATNR MTART.
read table itab_new with key MATNR = 'PAINT1' ERNAM = 'RAMANUM'
MTART = 'HAWA' MATKL = 'OFFICE'.
In the above code F, the read statement following the select statement is having the order of the keys as MATNR, ERNAM, MTART, MATKL. So it is less time intensive if the internal table is ordered in the same order as that of the keys in the read statement.
5. Performance Tuning Using Binary Search
A very simple but useful method of fine tuning performance of a read statement is using Binary search addition to it. If the internal table consists of more than 20 entries then the traditional linear search method proves to be more time intensive.
Code H
select * from mara into corresponding fields of table intab.
sort intab.
read table intab with key matnr = '11530' binary search.
Code I
select * from mara into corresponding fields of table intab.
sort intab.
read table intab with key matnr = '11530'.
Thanks
Seshu -
Performance problem while CPU is 80% Idel ?
Hi,
My end users are claim for performance problem during execution of batch process.
As you can see there are 1,745 statement executing each second.
Awr report shows 98.1% of the time , waits on CPU .
Also Awr report shows that Host CPU is :79.9% Idel.
The second wait event shows only 212 seconds waits on db file sequential read.
Yet , 4 minute in 1 hour period is seems not an issue.
Please advise
DB Name DB Id Instance Inst Num Startup Time Release RAC
QERP xxx erp 1 21-Jan-13 15:40 11.2.0.2.0 ; NO
Host Name Platform CPUs Cores Sockets Memory(GB)
erptst HP-UX IA (64-bit) 16 16 4 127.83
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 40066 22-Jan-13 20:00:52 207 9.6
End Snap: 40067 22-Jan-13 21:00:05 210 9.6
Elapsed: 59.21 (mins)
DB Time: 189.24 (mins)
Cache Sizes Begin End
~~~~~~~~~~~ ---------- ----------
Buffer Cache: 8,800M 8,800M Std Block Size: 8K
Shared Pool Size: 1,056M 1,056M Log Buffer: 49,344K
Load Profile Per Second Per Transaction Per Exec Per Call
~~~~~~~~~~~~ --------------- --------------- ---------- ----------
DB Time(s): 3.2 ; 0.1 ; 0.00 ; 0.05
DB CPU(s): 3.1 ; 0.1 ; 0.00 ; 0.05
Redo size: 604,285.1 ; 27,271.3
Logical reads: 364,792.3 ; 16,463.0
Block changes: 3,629.5 ; 163.8
Physical reads: 21.5 ; 1.0
Physical writes: 95.3 ; 4.3
User calls: 68.7 ; 3.1
Parses: 212.9 ; 9.6
Hard parses: 0.3 ; 0.0
W/A MB processed: 1.2 ; 0.1
Logons: 0.3 ; 0.0
Executes: 1,745.2 ; 78.8
Rollbacks: 1.2 ; 0.1
Transactions: 22.2
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 100.00 ; Redo NoWait %: 100.00
Buffer Hit %: 99.99 ; In-memory Sort %: 100.00
Library Hit %: 99.95 ; Soft Parse %: 99.85
Execute to Parse %: 87.80 ; Latch Hit %: 99.99
Parse CPU to Parse Elapsd %: 74.76 ; % Non-Parse CPU: 99.89
Shared Pool Statistics Begin End
Memory Usage %: 75.37 ; 76.85
% SQL with executions>1: 95.31 ; 85.98
% Memory for SQL w/exec>1: 90.33 ; 82.84
Top 5 Timed Foreground Events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Avg
wait % DB
Event Waits Time(s) (ms) time Wait Class
DB CPU 11,144 98.1
db file sequential read 52,714 214 4 1.9 User I/O
SQL*Net break/reset to client 29,050 6 0 .1 Applicatio
log file sync 2,536 6 2 .0 Commit
buffer busy waits 4,338 2 1 .0 Concurrenc
Host CPU (CPUs: 16 Cores: 16 Sockets: 4)
~~~~~~~~ Load Average
Begin End %User %System %WIO %Idle
0.34 ; 0.33 ; 19.7 ; 0.4 ; 1.8 ; 79.9Nikolay Savvinov wrote:
if the users are complaining about performance of the batch process, then that's what you should be looking at, not the entire system.I find it strange to see "end users" and "the batch process" in the same sentence (as it was in the first post). "End users" gives me the feeling of a significant number of concurrent sessions with people waiting for results in real time at the far end, while "batch process" carries the image a small number of large scale processes running overnight to prepare the data for the following morning.
I mention this because my first view of the AWR output was: you've got 16 CPUs, only three in use, virtually no users, and doing very little work, how can the users complain. (One answer, of course, is that the 13 CPUs could be locked out of use as far as Oracle is concerned). On the second read I decided that the "users" had gone home, and the complaint was simply that the batch process wasn't completing in time.
In this case I think "the entire system" IS "the batch process"
Determine which stored procedures and/or SQL statements took longer than usual and then find out why. Most likely you'll be able to find
everything you need in AWR views (DBA_HIST_SQL%) and ASH archive (DBA_HIST_ACTIVE_SESS_HISTORY).
If the batch process has changed dramatically and recently, then a simple first step might be to look at the current AWR report, find the few most time-consuming SQL statements, and use the awrsqrpt.sql script to find their history of execution plans.
But I'd also just look at the expensive SQL - bearing in mind, particularly, that there are very few user calls per second, yet many hundred executions per second: it strikes me that there could be quite a lot of PL/SQL going on doing something a little bit expensive many times or some PL/SQL function that calls some SQL that used to be called rarely from an SQL statement but is now (due, perhaps to a change in plan) being called much more frequently - so check SQL Ordered by Executions.
Regards
Jonathan Lewis -
Problem while selecting a table after creating the dblink
Hi,
We have created the dblink for oracle to sql server and it created successfully,
But while selecting the table from oracle we are getting the below issue,
select * from "sysdiagrams"@omniyat;
ERROR at line 1:
ORA-00942: table or view does not exist
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'sysdiagrams'. {42S02,NativeErr = 208}[Microsoft][ODBC SQL Server Driver][SQL
Server]Statement(s) could not be prepared. {42000,NativeErr = 8180}
ORA-02063: preceding 2 lines from OMNIYAT
Kindly provide us the solution to resolve this issue.
Regards
ShamPlease see:
Odbc Connection From Oracle To SQL*Server Fails With Errors Ora-28546 and Ora-2063 When Using Connection via Database Link. (Doc ID 1389492.1)
To BottomTo Bottom
Error 08001,NativeErr = 11 Instance Invalid or Not Running Connecting to SQL*Server Using Dg4MSQL (Doc ID 1349023.1)
How to Resolve Common Errors Encountered while using Database Gateways (DG4IFMX, Dg4MSQL, DG4SYBS), DG4ODBC or Generic Connectivity (Doc ID 234517.1)
Thanks,
Hussein -
Performance Problem while signing into Application
Hello
Could someone plz throw some light into which area I can look into for my performance problem. its an E-business suite version 11.5.10.2 which was upgrade from 11.5.8.
the Problem : When the Sign in Page is displayed , After the user name / Pwd is entered it sort of takes for ever for the System to actually log the user in. Sometimes I have to click twice on the Sign in Button.
I have run purge sign on audit / purge concurrent Request/manager logs / gather schema stats but its still slow. Are there any way of check whether the Middle Tier is the bottle neck.
Thanks
Ninican you check the profile option FND%diagnostic% if it was enabled or not
fadi
Maybe you are looking for
-
How to get 72 DPI on PowerBook G4 (1440x960) without black bars?
I love the high resolution screen on my PowerBook G4 (1440x960) -- but sometimes this ultra-high resolution screen is difficult to read. For example, screen fonts are designed to display at the proper size on 72 DPI screens, but on this screen they l
-
Unable to see imported RFCs in the BPM
Hi, I want to invoke a BAPI from a BPM, but I am unable to see the BAPI request / response interfaces in the BPM. I am trying to create Containers and Transformations in the BPM, but I am unable to select the BAPI request / response interfaces. What
-
HT204382 how can I transfer wma files to my mac?
how can I transfer wma files to my mac?
-
Balance Sheet G/L-PL reporting for period range by debit and credit amounts
Hi, good afternoon This report displays period intervals. One column must display G/L accounts and the others must perform: Initial balance, total debit and total credit. Example: <b>Period: mm.dd.yyyy to mm.dd.yyyy</b> Columns: G/L Account - Initial
-
Hello all. I have a very simple JS that I obtained from this forum several years ago. I recently imported it into CS3 and it errs right at the top in this line: b doc = app.activeDocument; but I don't find out about it until this line: b nroflinks =