How to get query execution time without running...?
Hi ,
I had one requirement .... as follows ......
i had 3 sql statements . I need to execute only one sql which execution time is very less.
Can any one help me , how to get query execution time without running that query and without using explain plan..?
Thanks,
Rajesh
Kim Berg Hansen wrote:
But you have ruled out explain plan for some reason, so I cannot help you.OP might get some answers if query was executed before - but since restart. Check V$SQL dynamic performance view for SQL_TEXT = your query. Then ROUND(ELAPSED_TIME / EXECUTIONS / 1000000) will give you average elapsed time.
SY.
Edited by: Solomon Yakobson on Apr 3, 2012 8:44 AM
Similar Messages
-
How to get the execution time of a query
Hi,
Environment: 10.2.0.4.0
Just wondering how I can get the query execution time? I am not interested in the query output nor do I want the statistics, just the execution time?
Any suggestions will be appreciated
Thanks in advance
rogers42If you're using SQL*Plus
SQL> set autotrace traceonly
SQL> set timing on
SQL> <<your query here>>SQL*Plus will fetch all the data and then report the query plan, execution statistics, and elapsed time. It will not display the actual data.
SET TIMING ON alone tells SQL*Plus to display the execution time of each SQL statement-- the problem is that it also displays all the data which can skew the results because you're including the time required by SQL*Plus to pipe a bunch of data to the screen.
Justin -
How to know query execution time in sql plus
HI
I want to know the query execution time in sql plus along with statistics
I say set time on ;
set autotrace on ;
select * from view where usr_id='abcd';
if the result is 300 rows it scrolls till all the rows are retrieved and finally gives me execution time as 40 seconds or 1 minute.. (this is after all the records are scrolled )
but when i execute it in toad it gives 350 milli seconds..
i want to see the execution time in sql how to do this
database server 11g and client is 10g
regards
rajwhat is the difference between .. the
statistics gathered in sql plus something like this and the one that i get from plan_table in toad?
how to format the execution plan I got in sqlplus in a proper understanding way?
statistics in sqlplus
tatistics
0 recursive calls
0 db block gets
164 consistent gets
0 physical reads
0 redo size
29805 bytes sent via SQL*Net to client
838 bytes received via SQL*Net from client
25 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
352 rows processedexecution plan in sqlplus... how to format this
xecution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=21 Card=1 Bytes=10
03)
1 0 HASH (UNIQUE) (Cost=21 Card=1 Bytes=1003)
2 1 MERGE JOIN (CARTESIAN) (Cost=20 Card=1 Bytes=1003)
3 2 NESTED LOOPS
4 3 NESTED LOOPS (Cost=18 Card=1 Bytes=976)
5 4 NESTED LOOPS (Cost=17 Card=1 Bytes=797)
6 5 NESTED LOOPS (OUTER) (Cost=16 Card=1 Bytes=685)
7 6 NESTED LOOPS (OUTER) (Cost=15 Card=1 Bytes=556
8 7 NESTED LOOPS (Cost=14 Card=1 Bytes=427)
9 8 NESTED LOOPS (Cost=5 Card=1 Bytes=284)
10 9 TABLE ACCESS (BY INDEX ROWID) OF 'USR_XR
EF' (TABLE) (Cost=4 Card=1 Bytes=67)
11 10 INDEX (RANGE SCAN) OF 'USR_XREF_PK' (I
NDEX (UNIQUE)) (Cost=2 Card=1)
12 9 TABLE ACCESS (BY INDEX ROWID) OF 'USR_DI
M' (TABLE) (Cost=1 Card=1 Bytes=217)
13 12 INDEX (UNIQUE SCAN) OF 'USR_DIM_PK' (I
NDEX (UNIQUE)) (Cost=0 Card=1)
14 8 TABLE ACCESS (BY INDEX ROWID) OF 'HDS_FCT'
(TABLE) (Cost=9 Card=1 Bytes=143)
15 14 INDEX (RANGE SCAN) OF 'HDS_FCT_IX2' (IND
EX) (Cost=1 Card=338)
16 7 TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_
COMM' (TABLE) (Cost=1 Card=1 Bytes=129)
17 16 INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK'
(INDEX (UNIQUE)) (Cost=0 Card=1)
18 6 TABLE ACCESS (BY INDEX ROWID) OF 'USR_MEDIA_CO
MM' (TABLE) (Cost=1 Card=1 Bytes=129)
19 18 INDEX (UNIQUE SCAN) OF 'USR_MEDIA_COMM_PK' (
INDEX (UNIQUE)) (Cost=0 Card=1)
20 5 TABLE ACCESS (BY INDEX ROWID) OF 'PROD_DIM' (TAB
LE) (Cost=1 Card=1 Bytes=112)
21 20 INDEX (UNIQUE SCAN) OF 'PROD_DIM_PK' (INDEX (U
NIQUE)) (Cost=0 Card=1)
22 4 INDEX (UNIQUE SCAN) OF 'CUST_DIM_PK' (INDEX (UNIQU
E)) (Cost=0 Card=1)
23 3 TABLE ACCESS (BY INDEX ROWID) OF 'CUST_DIM' (TABLE)
(Cost=1 Card=1 Bytes=179)
24 2 BUFFER (SORT) (Cost=19 Card=22 Bytes=594)
25 24 INDEX (FAST FULL SCAN) OF 'PROD_DIM_AK1' (INDEX (UNI
QUE)) (Cost=2 Card=22 Bytes=594) -
How to get Query response Time?
II am on BI 7.0. I ran some queries using RSRT command. I want to find how much time the queries took.
I went to
st03 -> expert mode -> BI system load-> select today / week/month according to the query runtime day
I do not see any Info Providers. Query was on a cube so why no Info Providers.
Does something have to turned on InfoPorvider to show.
When I look in RSDDSTAT_OLAP table, I do see many rows but cannot make any sense. Is there some documentation on how to get total query time from this table?
Is there any other way to get query response time?
Thanks a lot.HI,
why not use RSRT ? You can add database statistics option in "Execut & Debug" and you get all the runtime metrics of your query
In transaction RSRT, enter the query name and press u2018Execute +Debugu2019.
Selecting u2018Display Statistics Datau2019 .
After executing the query will return a list of the measured metrics.
The event id / text describes the steps (duration in seconds):
"OLAP: Read data" gives the SQL statements repsonse time (ok - because the SAP
application server acts as an Oracle client a little network traffic from the db server is included,
but as far as you not transferring zillions of rows it can be ignored)
But it gives you much more (i.e. if the OLAP cache gets used or not )...
In the "Aggreagate statistcs" you get all the infoproviders involved in that query.
bye
yk -
How to get the execution time of a Discoverer Report from qpp_stats table
Hello
by reading some threads on this forum I became aware of the information stored in eul5_qpp_stats table. I would like to know if I can use this table to determine the execution time of a worksheet. In particular it looks like the field qs_act_elap_time stores the actual elapsed time of each execution of specific worksheet: am I correct? If so, how is this value computed? What's the unit of measure? I assume it's seconds, but then I've seen that sometimes I get numbers with decimals.
For example I ran a worksheet and it took more than an hour to run, and the value I get in the qs_act_elap_time column is 2218.313.
Assuming the unit of measure was seconds than it would mean approx 37 mins. Is that the actual execution time of the query on the database? I guess the actual execution time on my Discoverer client was longer since some calculations were performed at the client level and not on the database.
I would really appreciate if you could shed some light on this topic.
Thanks and regards
GiovanniThanks a lot Rod for your prompt reply.
I agree with you about the accuracy of the data. Are you aware of any other way to track the execution times of Discoverer reports?
Thanks
Giovanni -
How to get query response time from ST03 via a script ?
Hello People,
I am trying to get average query response time for BW queries with a script (for monitoring/historisation).
I know that this data can be found manually in ST03n in the "BI workload'.
However, I don't know how to get this stat from a script.
My idea is to run a SQL query to get this information, here is the state of my query :
select count(*) from sapbw.rsddstat_olap
where calday = 20140401
and (eventid = 3100 or eventid = 3010)
and steptp = 'BEX3'
The problem is that this query is not returning the same number of navigations as the number shown in ST03n.
Can you help me to set the correct filters to get the same number of navigation as in ST03n ?
Regards.Hi Experts,
Do you have ideas for this SQL query ?
Regards. -
How to get the query execution time
Hi,
I am new to oracle and I am trying to get the execution time of a query.I tried the command set timing on and executed the query.But,the time it gives me is including the display of results.In my case,I ran a query against 50 million records and it is taking around 5 hours to display all the results.I like to know,how much time it take just to execute the query?Please help.
Thanks
Ravi.Maybe this way ?
TEST@db102 SQL> set timing on
TEST@db102 SQL> set autotrace traceonly
TEST@db102 SQL> select * from foo;
332944 rows selected.
Elapsed: 00:00:29.04
Execution Plan
Plan hash value: 1245013993
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 274K| 46M| 1071 (5)| 00:00:13 |
| 1 | TABLE ACCESS FULL| FOO | 274K| 46M| 1071 (5)| 00:00:13 |
Note
- dynamic sampling used for this statement
Statistics
288 recursive calls
0 db block gets
26570 consistent gets
4975 physical reads
0 redo size
35834383 bytes sent via SQL*Net to client
244537 bytes received via SQL*Net from client
22198 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
332944 rows processed
TEST@db102 SQL> -
How can I reduce BEx Query execution time
Hi,
I have a question regarding query execution time in BEx.
I have a query that takes 45 mins to 1 hour to execute in BEx analyser. This query is run on a daily basis and hence I am keen to reduce the execution time. Are there any programs or function modules that can help in reducing query execution time?
Thanks and Regards!Hi Sriprakash,
1.Check if your cube is performance tuned: in the manage cube from RSA1 / performance tab: check if all indexes and statistics are green. Aggregate IDx should as well be.
2.Condense your cubes regularly
3. Evaluate the creation of an aggregate with all characteristic used in the query (RSDDV).
4.Evaluate the creation of a "change run aggregate": based on a standalone NavAttr (without its basic char in the aggr.) but pay attention to the consequent change run when loading master data.
5. Partition (physically) your cubes systematically when possible (RSDCUBE, menu, partitioning)
6. Consider logical partitioning (by year or comp_code or ...) and make use of multiproviders in order to keep targets not too big...
7.Consider creating secondary indexes when reporting on ODS (RSDODS)
8.Check if the query runtime is due the master data read or the infoprovider itself, or the OLAP processor and/or any other cause in tx ST03N
9.Consider improving your master reads by creating customized IDX (BITMAP if possible and depending on your data) on master data table and/or attribute SIDs when using NAvs.
10.Check that your basis team did a good job and have applied the proper DB parameters
11.Last but not least: fine tune your datamodel precisely.
hope this will give you an idea.
Cheers
Sunil -
How to reduce the query execution time
hai all,
We have created query on Purchasing Cube 0PUR_C01 for
Purchase Order (PO) analysis for single vendor materials, but it is taking long time to execute (about 45 sec...).
In the above Query we have used the following things:
In Columns:
i) Exceptional aggregation for maximum & minimum PO Net Price using reference characteristic as Calendar Day.
ii) Minimum PO Price value we have multiplied with Actual GR Quantity for the calculation of Impact of Lowest PO Net Price.
iii) Number of vendors calculated key figure.
In Rows:i) Only Material
In Filters:
i) Plant with variable select Option u2013 Optional.
ii) Calendar Year / Month with Select Option u2013 Optional.
iii) Material with excluded Unassigned (#).
iv) Vendor with excluded Unassigned (#).
Following are we have used for Performance:
i) Aggregates using Propose from query (only for this query).
ii) Partitioning on Calendar Year / Month (For 1 year 14 partitions) i.e. (04.2007 to 03.2008).
iii) Collapse.
iv) In RSRT we have set the following properties
Read Mode = H
Req.Status = 0
Catch Mode = 4
Persistence Mode = 3 (BLOB)
Optimization mode = 0.
Our inputs to this Query:
i) We are passing plant range 1201 to 1299.
ii) Calendar Year / Month 04.2007 to 03.2008.
So please suggest me how to reduce the execution time.
please help me.
Thanks,
kiran manyamHi,
First of all its a complete question with all the details. Good work.
As you partitioned the cube based on calmonth and you are also giving calmonth in selection, it will definitely work towards improved query performance.
As you are putting plant values in the selection, is there any aggregate available on plant characteristics? If not creating a aggregate on plant will help.
Regards,
Yogesh -
How to get the recovery time of transient response of a power supply with Labview basic package without analysis option? Does anyone have any idea or some similar function SUBVIs?
Recovery time of transient response is defined as the time from the beginning of the transient to the voltage point on the waveform fallen into 10percent of the overshoot. Well, the waveform is something like a pulse with a soft slope.I recommend plotting your data on a graph on paper. Take a look at the data, and determine what is unique about the point you are looking for. Look for how you can teach your program to look for this point.
I have written several algorithms that do similar, one in fact being for a power supply, the other being for RPM. Neither algorithm used any advanced analysis tools. They are just a matter of determining, mathematically, when you achieve what you are looking for. Just sit down with your graph (I recommend multiple copies) and draw horizontal and vertical lines that determine when you get to the point you are looking for. You are probably going to have to reverse the array and start from the end, so think in those terms.
If you have trouble, emai
l me a bitmap of the graph, and what you are looking for and I will try to be of further assistance. Don't do that however; until you you have given this a few tries. Your solution should be involve a lot of logic on analog levels.
Good luck -
How to get the CPU time of a query?
Hello all, will someone pls tell me how to get the CPU time instead of Elapsed Time of a query?
Thanks.If i am not wrong, Jonathan Lewis blogged about the changed behaviour.
Here is short test:
SQL> CREATE OR REPLACE FUNCTION Cpu RETURN NUMBER IS
2 Retval NUMBER;
3 BEGIN
4 SELECT m.VALUE
5 INTO Retval
6 FROM V$statname s, V$mystat m
7 WHERE s.Statistic# = m.Statistic#
8 AND NAME = 'CPU used by this session';
9 RETURN Retval;
10 END;
11 /
Function created.
cat cpu_test.sql
DECLARE
TYPE t IS TABLE OF NUMBER;
tt t;
BEGIN
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM all_objects;
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY object_type) BULK COLLECT INTO tt FROM user_objects;
dbms_output.put_line(cpu());
SELECT COUNT(*) over(PARTITION BY owner) BULK COLLECT INTO tt FROM dba_objects;
dbms_output.put_line(cpu());
END;
SQL> select * from v$version
2 /
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Linux: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
SQL> @cpu_test
0
0
0
0
PL/SQL procedure successfully completed.
SQL> @cpu_test
106
106
106
106
PL/SQL procedure successfully completed.
SQL> select * from v$version
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
SQL> set serveroutput on
SQL> @cpu_test
1
129
130
145
PL/SQL procedure successfully completed.
SQL> @cpu_test
145
273
275
290
PL/SQL procedure successfully completed.Best regards
Maxim -
How to know exact query execution time.
Hi,
I want to know what is exact query execution time which excludes network access, constructing results. Please suggest me.
Thanks in advance,
Satish.GNot sure I know what you really want, but if this is a testing phase sort of thing and you are running on unix, there is the time command.
If you want something that is part of your application, you can run a timer in a separate Thread - for approximate time.
If you want more precise time, you can use java.util.Date - it has a method getTime(), which you can use before processing and again after processing and subtract the former from the later. -
Oracle View that stores the Query execution time
Hi Gurus
i m using Oracle 10G in Unix. I wudiold like to know which Data dictionary view stores the execution of a query. If it is not stored then hw to find the query execution time other than (Set timing on) command. What is the use of elapsed time and what is the difference between execution time and elapsed time? How to calculate the execution time of a query.
THanks
RamIf you have a specific query you're going to run in SQL*Plus, just do
a 'set timing on' before you execute the query.
If you've got application SQL coming in from all over the place, you can
identify specific SQL in V$SQL/ and look at ELAPSED_TIME/EXECUTIONS
to get an average elapsed time.
If you've got an application running SQL, and you need to know the
specific timing of a specific execution (as opposed to an average),
you can use DBMS_SUPPORT to set trace in the session that your
application is running in, and then use TkProf to process the resulting
trace file. -
Hi,
I have a query which fetches around 100 records from a table which has approximately 30 million records. Unfortunately, I have to use the same table and can't go ahead with a new table.
The query executes within a second from RapidSQL. The problem I'm facing is it takes more than 10 minutes when I run it through the Java application. It doesn't throw any exceptions, it executes properly.
The query:
SELECT aaa, bbb, SUM(ccc), SUM(ddd), etc
FROM MyTable
WHERE SomeDate= date_entered_by_user AND SomeString IN ("aaa","bbb")
GROUP BY aaa,bbbI have an existing clustered index on SomeDate and SomeString fields.
To check I replaced the where clause with
WHERE SomeDate= date_entered_by_user AND SomeString = "aaa"No improvements.
What could be the problem?
Thank you,
LoboIt's hard for me to see how a stored proc will address this problem. I don't think it changes anything. Can you explain? The problem is slow query execution time. One way to speed up the execution time inside the RDBMS is to streamline the internal operations inside the interpreter.
When the engine receives a command to execute a SQL statement, it does a few things before actually executing the statement. These things take time. First, it checks to make sure there are no syntax errors in the SQL statement. Second, it checks to make sure all of the tables, columns and relationships "are in order." Third, it formulates an execution plan. This last step takes the most time out of the three. But, they all take time. The speed of these processes may vary from product to product.
When you create a stored procedure in a RDBMS, the processes above occur when you create the procedure. Most importantly, once an execution plan is created it is stored and reused whenever the stored procedure is ran. So, whenever an application calls the stored procedure, the execution plan has already been created. The engine does not have to anaylze the SELECT|INSERT|UPDATE|DELETE statements and create the plan (over and over again).
The stored execution plan will enable the engine to execute the query faster.
/> -
Query runtime vs Query execution time
Hi,
I am trying to find the most executed queries (how often queries are executed) in our BI system.
I got query runtime from Hitlist in st03 Reporting analysis.
could someone tell me if its same as query execution time or where can I check most executed queries or how often are queries executed.
thankshi,
I hope you already installed the statistics.
You can get lot of details like which quereis are being used and their history and how many times they executed and by whom , when and also tells DB, OLPA, and Frontend times in ST03N in Expert mode
refer below thread
Re: BEx Query is executed how many times???
also refer help - navigate to BW Statistics MultiProvider Queries
http://help.sap.com/saphelp_nw04s/helpdata/en/44/10cb9a8f345cf9e10000000a155369/frameset.htm
hope it helps u
Thanks
Edited by: Srinivas on Oct 30, 2008 9:42 PM
Maybe you are looking for
-
With the prior version of Firefox I could convert web pages (financial data) to pdf for maintaining historical files. And then with the pdf, I was able to copy and paste the numbers into Excel. With Firefox4, I can convert to pdf with Acrobat but I c
-
10gR2, Installation of Oracle Text: Data Mining license required?
Hello all, 1. I wonder if I have to obtain a Data Mining license if I want to use Oracle Text. Using DBCA I have to check "Data Mining" to be able to check "Oracle Text". 2. Does Oracle Text work, when I previously removed data mining using "make -f
-
MB Pro keeps crashing, not restarting.
I've been having some problems with my Macbook Pro lately. For example, it doesn't always go to sleep when I close the lid, and somehow drains the battery in a couple of hours when this happens. It's running Yosemite 10.10.2, it's a mid 2012, 13-inch
-
Any bapi or FM for doing picking or PGI
Hi All I want to do picking and PGI for outbound deliveries. i tried using ws_delivery_update, its taking the pick quantity but not the batch number, for picking I just want to put the pick quantity same as delivery quantity and the batch say 'XYZ'
-
Create single file to play multiple mpegs - os x?
My Hitachi camcorder creates mpeg 2's - which I can play on the Mac (OS X - latest version) using the Mpeg 2 playback component. However it also creates the handy "playall" file which does just that. Any ideas on how to create one of these files or s