Select query giving Time out dump
Hi All,
I have written a select query on a table in BW system.The code for the same is attached below.The table contains some 6,00,000 records.This query is giving a time out error.Kindly look into the query and advice ways to make it work.Thanks.
IF NOT lt_temp[] IS INITIAL.
SELECT /bic/zprrmatnr objvers /bic/zprclwynr /bic/zprrmdlr
FROM /bic/pzprrmatnr
INTO CORRESPONDING FIELDS OF TABLE lt_zprrmatnr
FOR ALL ENTRIES IN lt_temp
WHERE /bic/zprclwynr = lt_temp-temp
AND objvers = 'A'.
ENDIF.
Thanks and Regards,
Faisal
Not only is it BW, it is also a customer table. Have a look here on how to research yourself:
Please Read before Posting in the Performance and Tuning Forum
Thomas
Similar Messages
-
Regarding query giving time out
Hi,
We are facing issue in running a query.
select max(eptimestamp) from table1 where slno='12324'
The query was getting hanged and we tried recreating the index for the slno
and then it started working but it is taking more than 6 mins to execute the same.
but the below query is working fine
select max(eptimestamp) from table1.
The query was working perfect and suddenly it started giving error
Could any one please help us on this issue.
Thanks for all your support.I guess the "timeout" is imposed by the application ?
How many rows do you have for "slno='12324' " ? How many distinct eptimesetamps exist for " slno='12324' " ?
you could post an explain plan for the query.
Either
a. Oracle is using the index and fetching all the rowids and then going to the table to get the "eptimestamp" for each of these rowids (thus doing many more reads)
or
b. Oracle is doing a full table scan
It is likely that a concatenated index on (slno,eptimestamp) can help you but we'd need to know how many distinct values there are and in relation to the total number of rows in the table. -
Performance tuning for a time-out dump
Hi ,
actually there is a following piece of code(a SELECT query) in my program,due to which TIME OUT dump occurs.plz help me to modify the code to reduce it's execution time.
code is:
DATA: at_seque_extref TYPE zprms_ord_ind OCCURS 0 WITH HEADER LINE.
SELECT (sv_fields) FROM zprms_ord_ind
APPENDING CORRESPONDING FIELDS OF TABLE at_seque
UP TO lv_max_sequs ROWS
WHERE process_type IN lr_process_type
AND posting_date IN lr_pos_date
AND sol_date IN lr_sol_date
AND changed_at IN lr_chg_date
AND external_ref NE space
AND (ls_where)
AND ib_comp_network IN lr_ibc_netw
AND ib_comp_node IN lr_ibc_node
AND ib_comp_site IN lr_ibc_site
ORDER BY (iv_order_by).
CLEAR at_seque_extref.
LOOP AT at_seque.
IF at_seque-external_ref CP is_bus_trans_search-external_ref .
MOVE-CORRESPONDING at_seque TO at_seque_extref.
APPEND at_seque_extref.
ENDIF.
ENDLOOP.
CLEAR at_seque[].
*the table at_seque[] type zprms_ord_ind
Or plz suggest me check points to reduce it's execution time.Hi Ahmed,
Rarther going to appending go for into corresponding field of table at_seque.
Also check the primary key combination before selecting any data into where condition.
Remove that NE condition from where clause because some time it will take time to extract data. GO for delete statement into at_seque after select statement.
This will definitely work.
<b>Rewards points if useful.</b>
Regards,
Kinjal -
Time Out Dump while extracting data from table CKIS
Dear Friends,
I am getting TIme Out dump for the below code, while extracting data from table CKIS.
Table CKIS doesn't have any Indexes. Please guide me to resolve this.
Regards,
Viji.
form get_keko_ckis.
SELECT kalnr kalka kadky tvers bwvar matnr werks kokrs
FROM keko
INTO TABLE i_keko1
FOR ALL ENTRIES IN i_final_modify
WHERE matnr = i_final_modify-main_f
AND werks = p_werks
AND kokrs = p_kokrs
AND kadat = p_kadat
AND bidat = p_bidat
AND bwdat = p_bwdat.
IF sy-subrc = 0.
SORT i_keko1 BY kalnr kalka kadky tvers bwvar.
SELECT kalnr kalka kadky tvers bwvar posnr typps kstar
matnr menge gpreis
FROM ckis
INTO TABLE i_ckis_temp
FOR ALL ENTRIES IN i_keko1
WHERE kalnr = i_keko1-kalnr
AND kalka = i_keko1-kalka
AND kadky = i_keko1-kadky
AND tvers = i_keko1-tvers
AND bwvar = i_keko1-bwvar.
IF sy-subrc = 0.
SORT i_ckis_temp BY kalnr kalka kadky tvers bwvar.
LOOP AT i_ckis_temp INTO wa_ckis_temp.
wa_ckis-kalnr = wa_ckis_temp-kalnr.
wa_ckis-kadky = wa_ckis_temp-kadky.
wa_ckis-posnr = wa_ckis_temp-posnr.
wa_ckis-typps = wa_ckis_temp-typps.
wa_ckis-kstar = wa_ckis_temp-kstar.
wa_ckis-matnr1 = wa_ckis_temp-matnr1.
wa_ckis-menge = wa_ckis_temp-menge.
wa_ckis-gpreis = wa_ckis_temp-gpreis.
CLEAR wa_keko1.
READ TABLE i_keko1 INTO wa_keko1
WITH KEY kalnr = wa_ckis_temp-kalnr
kalka = wa_ckis_temp-kalka
kadky = wa_ckis_temp-kadky
tvers = wa_ckis_temp-tvers
bwvar = wa_ckis_temp-bwvar
BINARY SEARCH.
IF sy-subrc = 0.
wa_ckis-matnr = wa_keko1-matnr.
wa_ckis-werks = wa_keko1-werks.
ENDIF.
APPEND wa_ckis TO i_ckis.
CLEAR: wa_ckis_temp, wa_ckis.
ENDLOOP.
ENDIF.
REFRESH: i_keko1, i_ckis_temp.
ENDIF.
endform. " get_keko_ckisHi Try minimising the conditions in where clause
SELECT fields..... FROM CKIS
WHERE KALNR = KEKO-KALNR AND
KADKY = KEKO-KADKY AND
TVERS = KEKO-TVERS AND
TYPPS = 'M'.
after this, deleting unwanted records from internal table as per pending conditions...
Regds,
Anil -
Getting Time Out Dump while Executing Report
Hello ABAP Experts,
I am trying to execute a report, but while debugging I am getting time out dump on 2nd SELECT statement.
SELECT vbeln
matnr
werks
lgort
volum
lgnum
FROM lips
INTO TABLE i_volume
FOR ALL ENTRIES IN i_likp
WHERE vbeln EQ i_likp-vbeln
AND lgort IN s_lgort
AND werks IN s_werks.
IF i_volume[] IS INITIAL.
MESSAGE text-001 TYPE 'I'.
STOP.
ENDIF.
SORT i_volume BY vbeln.
SELECT matnr
meinh
umrez
umren
FROM marm
INTO TABLE gt_marm
FOR ALL ENTRIES IN i_volume
WHERE matnr = i_volume-matnr
AND meinh = 'ME' OR meinh = 'KG'.
IF sy-subrc EQ 0.
SORT gt_marm BY matnr.
DELETE ADJACENT DUPLICATES FROM gt_marm COMPARING matnr.
ENDIF.
Can you please help me out there ?
Thanks
SwanandHi Swanand,
try
WHERE matnr = i_volume-matnr
AND ( meinh = 'ME' OR meinh = 'KG' ).
you should also filter first materials to a temporary table with only distinct matnr entries and use it instead of i_volume.
regards,
Edgar -
Hi Experts ,
When i run a particular application and then keep it open for some time .
Then when i try to run it , it gives a dump ..saying " time out "..
Can anyone suggest any alternative for this .
Thank You.
Radhika.hi
good
go through this link hope this would help you to give the idea about the time out dump.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7fdca26e-0601-0010-369d-b3fc87d3a2d9
reward point if helpful.
thanks
mrutyun^ -
Hi,
We have a select query written as below:
SELECT counter
stokz
pernr
workdate
rnplnr
catshours
FROM catsps
INTO TABLE t_catsps
WHERE pernr IN r_pernr
AND workdate IN s_wrkdt
AND rnplnr IN s_ntwrk
AND belnr IN s_docno
AND transfer NE 'X'.
Here, the range which we are using has a record of more than 16000. At this particular portion of the code the program dumps. I suspect it is due to the excessive data records in the ranges option. Is there any remedy for this situation. Please help!Hi,
check the inetrnal table strcure field are of same type of catsps table field which you are fetching
Or try to USe into corresponding fields of table t_catsps.
"check the inetrnal table strcure field are of same
"type of catsps table field which you are fetching
SELECT counter
stokz
pernr
workdate
rnplnr
catshours
FROM catsps
INTO TABLE t_catsps 'Or try to USe into corresponding fields of table t_catsps
WHERE pernr IN r_pernr
AND workdate IN s_wrkdt
AND rnplnr IN s_ntwrk "check rnplnr and s_ntwrk are of same type
AND belnr IN s_docno "Check belnr and s_docno are of same type
AND transfer NE 'X'.
"hadle sy-subrc
prabhudas
Edited by: Rob Burbank on Sep 22, 2010 9:32 AM -
Running query report times out
All,
At my customer we have a BW3.1 system.
When running a query using ta rsrt it times out after 1 hour. The query/report should be done in 5 minutes but somehow it gets stuck.
With an SQL trace we see no queries and in the Dialog work process we do not see any update on new records being read.
When its started it starts building/reading a temporary table: BI0/03010 but its get stuck and times out eventually.
We also ran the drop temp tables job and rerun the query, however this does not help.
Does anyone have any ideas where to look?
Grt,
SjoerdRun ti through RSRT in debug mode and display the SQL run schedule - then go and look at the query execution path
If your cube is partioned try and make sure you get the partioning object into the where clause (ie 0fiscper or 0calmonth) - if you cant get it on a selection screen - try and derive it in a cmod in a filter
Next - check that the database stats are current for the entries in the query
Go to the query exection path and click on the tables - they will give you the last statistics date
Updating the db stats can have a dramatic effect on the order you see in the query execution path
The temp table is probably a hierarchy build - these are a nightmare for large hierarchies - but go with the other things first -
Select count(*) cause time out error
I invoke the following statement:
select count(*) as total from table1
where table1 is large(30000 rows), total size of the database is more than 20GB.
The above statement will cause time out error. How to solve the problem?Hallo chcw,
a timeout in a table with 30.000 records is very unusual (for a simple SELECT COUNT). From my point of view Dan is on the right way and you will have a typical blocking scenario.
1. if you have LOBs they won't be part of a SELECT COUNT (either its a heap of a clustered index)
2. Microosft SQL Server will ALWAYS use the smallest index for such a simple SELECT
3. if it is a heap you will run into a blocking scenario if someone is updating records and transaction has not committed.
4. Check the isolation level of the transactions - but I expect the standard which is "read committed".
Just a demonstration of "SELECT COUNT" will work whether it is a clustered index or a heap. The next script will create a heap with a LOB and additional attributes:
CREATE TABLE dbo.foo
Id INT NOT NULL IDENTITY(1,1),
n1 INT NOT NULL,
n2 SMALLINT NULL,
c1 CHAR(250) NOT NULL,
c2 CHAR(250) NULL,
c3 VARCHAR(MAX) NOT NULL DEFAULT (REPLICATE('A', 15000))
GO
Now we enter 30,000 records into the table
SET NOCOUNT ON;
DECLARE @i INT = 1;
WHILE @i <= 30000
BEGIN
INSERT INTO dbo.foo (n1, c1) VALUES (@i, 'Just a filler');
SET @i += 1;
END
GO
Keep in mind that we have a HEAP and NO indexes! To check the IO i use the following command befor any of the following examples:
SET STATISTICS IO ON;
GO
Let's start with a first try and you will check as a result the produced IO depending on the affected table partitions:
-- USE SELECT in a HEAP
SELECT COUNT(*) FROM dbo.foo;
GO
Output:
Table 'foo'. Scan count 1, logical reads 2508, ..., lob logical reads 0,
As you can see from the result the LOB-data won't be attached only the "in-row-data" are affected (which are stored in 2508 pages. The reason is a quite simple one: Microsoft SQL Server uses different allocation units for in-row-data and LOB
SELECT p.object_id, p.index_id, p.rows, au.total_pages
FROM sys.partitions AS P INNER JOIN sys.allocation_units AS AU
ON(p.partition_id = au.container_id)
WHERE object_id = OBJECT_ID('dbo.foo');
Now I create a simple index on the column n1 which is an INT-datatype
SELECT p.object_id, p.index_id, p.rows, au.total_pages
FROM sys.partitions AS P INNER JOIN sys.allocation_units AS AU
ON(p.partition_id = au.container_id)
WHERE object_id = OBJECT_ID('dbo.foo');
and run the SELECT COUNT again with the following IO-output:
Table 'foo'. Scan count 1, logical reads 69, ...
WOW - only 69 pages have to be read. The explanation is a quite simple one - now we have an index which is quite small. Microsoft SQL Server WILL use the smallest index of a table to scan the number of records. Let's try it again with n2 which is a smallint
(2 bytes)
CREATE NONCLUSTERED INDEX ix_foo_n2 ON dbo.foo (n2);
GO
The IO will be 62 (or less) because MORE index records a fitting to one data page!
Conclusion is that either you have small record size or long record size - The query optimizer will always use the smallest index for the execution (that's maybe why Visahk has asked for the execution plan).
I don't believe it is because of the "huge amount of data" but - as Dan has pointed out - it HAS TO BE a blocking scenario which can have multiple reasons. For demonstration of a blocking scenario open SSMS and start in the query windows with the following
command(s):
BEGIN TRANSACTION
UPDATE dbo.foo
SET c1 = 'This is my name'
WHERE Id = 10000;
-- What locks do we have now in the database
SELECT resource_description,
resource_associated_entity_id,
request_mode,
request_type
FROM sys.dm_tran_locks AS DTL
WHERE resource_database_id = DB_ID() AND
resource_type != 'DATABASE';
Your result should look like that (with differences in the entity_id and resource descriptions :)
The above pic demonstrates the "locking chain". As you can see the slot 7 on PAGE 82400 has an exclusive lock. This means that NO OTHER request can currently obtain another lock to it!
Now open a second query window and run a SELECT COUNT... - it will not finish!
The reason is that the second requests has to wait for the release of the locked resources by the first transaction! Leave the statement and change back to the first transaction and finish the transaction by cancellation of the query. In the moment the locks
have been released the second query will finish immediate.
So - from my point of view - Dan has given the correct answer. Against wide spreaded statements a heap won't block the whole table exclusivly but - as in a cluster, too - only the row itself (see the 7 which is the slot where the record exists).
MCM - SQL Server 2008
MCSE - SQL Server 2012
db Berater GmbH
SQL Server Blog (german only) -
Dynamic From statement in select query and/or outer join not working
Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
Select (dynamic columns) INTO <wa>
FROM a inner join b on af1 = bf1
inner join c on af2 = cf2......
WHERE (dynamic conditios)
ORDER BY ( dynamic sort condition).
Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
Kindly give me pointers.
ThanksHey thanks for the reply, but the problem is not solved.
I am already using ( fileds, value) like table in my where condition and the select statement was working properly.
the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
But I am getting a runtime error as below:
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
caught in
procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The running ABAP program wanted to execute a SELECT statement whose
WHERE condition was (partly) specified dynamically. The part that is
specified in an internal table at runtime is compared to a field of the
right table of an LEFT OUTER JOIN. Such comparisons are not supported by
all database systems and are therefore not allowed. -
Hi Friends,
now here i have question. from st22 we can get list of query time out in production and from error log by fill_sp function we can get ABAP program name from which we can get querie's detail like name, cube name etc...
but i am facing some of the query time out gives ABAP program name but cannt get query info from that !!! i tried it by se38 by that also i didnt find all the query info for few time out. is there any way i can get info for those query time out ??
please reply to my as i am new to this forums....last time when i asked questions noone replied me !!!
waiting for help !!Hi,
if my question is not clear then let me just ask in general.
from st22 how can i get query name which have been time out ??
can u please elaborate the process ?
thank you in advance and i will give the points once i get the solution. -
Select Query on time stamp.
Hello Gurus,
Please help me in writing a select query with the where condition on time stamp for the field IBSP-VALFR and IBSP-VALTO, with the current system time stamp. I need pick all the values which falls in these two fields with the current time stamp.
Thanks & Regards,
Naresh.Hi,
some how my code is not working...Please look at my code.
convert date sy-datum
time sy-uzeit
into time stamp low_validity
time zone sy-zonlo.
SELECT SP_INSTANCE INSTANCE EQUNO MATNO SERNO
FROM IBSP INTO TABLE IT_IBSP
for all entries in it_IBIN
where ( SP_INSTANCE = IT_IBIN-INSTANCE OR
INSTANCE = IT_IBIN-INSTANCE ) and
VALFR Le low_validity and
VALTO ge low_validity.
Its getting the values for which VALTO is less than current date.
Thanks & Regards,
Naresh. -
Must add the never option to the time out period or the product is useless for navigation and other purposes where continual use is required.
This should be an option in the General settings on your iPad. The option is called Auto-Lock. There should be the following options: 2 minutes, 5 minutes, 10 minutes, 15 minutes, and Never.
If you select Never, that should stop the screen from going to sleep automatically. If the Never option is not present, you more than likely have a Exchange account synced with the device that does not allow that option. If that account is disabled, that option should show.
Cheers, Tom -
Hi can Some one help me how to fit the query in the Main query, I need to selete SYS_ID the below Work around query is getting the output correctly
but when i tried to put in the main query am getting ORA-00933 not sure how to fix this. Can some one advice me where am making wrong.
Work Around query :
SELECT ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
IN ( SELECT MEDCO.RE_MEDCD_ID_NUM
FROM N09.T_MEDCD_ID MEDCO
INNER JOIN N09.T_POLY POLY
ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID
Need to integerate the above column in the below query.
Main Query :
SELECT 'Diff' AS SC,
POLY.ID,
ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
IN ( SELECT MEDCO.RE_MEDCD_ID_NUM
FROM N09.T_MEDCD_ID MEDCO
INNER JOIN N09.T_POLY POLY
ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,
NULL AS BEG_DT,
NULL AS ID,
FROM
N09.T_POLY POLY
Oracle Version : 10gR2
Thanks in advance.Hi,
Hillbird wrote:
Hi Frank,
Thanks for your responces. The Error am getting is at line number 7 & col# 55 -- ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID) AS B_SYS_ID,.
I also changed the alias name in thesubquery as S-poly and left the main query alias as POLY. You still haven't posted a completed query, or any sample data and results.
But still i am getting the same error message.
Error Message
ORA-00933 : Sql command not properly ended
oo933 00000 - "Sql command not properly ended"
Vendor Code 933 Error at line 7 column 55
Iam framing a select query, The work around query is used to checkhow to reterive the value from the DB and with the business rules. on which the framing
select query the B_sys_id comes in column 3 and i still have more columns to select. Hence i even tried as below
SELECT 'Diff' AS SC,
POLY.ID,
ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
IN ( SELECT MEDCO.RE_MEDCD_ID_NUM
FROM N09.T_MEDCD_ID MEDCO
WHERE POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID),
NULL AS BEG_DT,
NULL AS ID,
FROM
N09.T_POLY POLY
But still the same error message i got.
Hence i just tried as below
SELECT 'Diff' AS SC,
1 as dummy,
2 as dummy_1,
ALTID.B_SYS_ID FROM N08.B_ALT_ID_TB ALTID WHERE ALTID.B_ALT_ID
IN ( SELECT MEDCO.RE_MEDCD_ID_NUM
FROM N09.T_MEDCD_ID MEDCO
INNER JOIN N09.T_POLY POLY
ON POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID)
This is working.
Can you please let me know what is that i need to do if i want to add more columns in the select clause after
this line ON POLY.REUNIQUE_ID = MEDCO.RE_UNIQUE_ID)_
Thanks.
A query (not counting sub-queries) has, at most, only one of each type of clause: one SELECT clause, followed by one FROM clause, followed (optionally) by one WHERE clause. All items to be returned go together in the one SELECT clause. All tables needed are named in the on FROM clause. All filtering conditions go together in the one WHERE clause.
Perhaps you meant something like this:
SELECT 'Diff' AS SC
, POLY.ID
, ALTID.B_SYS_ID
, NULL AS BEG_DT
, NULL AS ID
FROM N08.B_ALT_ID_TB ALTID
JOIN N09.T_POLY POLY ON altid.column_a = poly.column_b
WHERE ALTID.B_ALT_ID IN (
SELECT MEDCO.RE_MEDCD_ID_NUM
FROM N09.T_MEDCD_ID MEDCO
WHERE POLY.RE_UNIQUE_ID = MEDCO.RE_UNIQUE_ID
)With the little information I have, I can't even guess what the real join condition(s) might be. I used
ON altid.column_a = poly.column_bjust to show the correct syntax. -
Power Query increase time out time (HTTP)
Hi
I am trying to send a http request that can take 5 mins or more to process. Is there anyway to increase the time out time?
last comment ( seems to suggest it is fixed at 100 seconds for http requests)
http://social.technet.microsoft.com/Forums/en-US/258c0872-15d8-42dc-bf8f-f836d4e51c92/increase-timeout-for-net-data-provider-for-teradata?forum=powerqueryThe ability to override this timeout is planned as part of the July release.
Maybe you are looking for
-
Print report on network/local printer
Hi forms gurus, I repost this topic because it's very important to me.We have at a lot application witch work in client/server mode using forms/Reports 6i.With these applications we haven't problem to print report on printer using RUN_PRODUCT.Now we
-
Error while deploying in 9.2 Beta Weblogic App Server
This is the message i am getting while deploying a J2EE application in the Weblogic 9.2 Beta App Server. Please help: Unable to access the selected application. [J2EE Deployment SPI:260101]Parameter may not be null. java.lang.NullPointerException at
-
Installed UEFI Diagnostics but it doesn't seem to run
This regards an HP Pavilion dv6t-7000 CTO Entertainment Notebook PC. I'm trying to run hardware diagnostics to find out whether my motherboard has a problem. (New battery is plugged in but not charging.) I downloaded HP UEFI Support Environment (Vers
-
Open saved draft report via API/UI
How could I open an saved Draft report via API/UI. I have draft an report via API/UI and now I would show this report on Desktop/SAP
-
Difficulty with random bingo card generator
Hi! I'm trying to generate a random bingo card in Flash using ActionScript. The psudeo-code is pretty sound, I think, but I can't even get the first number onto the card. I'm trying a random number variant with output to a dynamic text field. No succ