SQL query execution time calculation

Solved
firejoke Posted messages 20 Status Member -  
 zaggg -
Hello everyone,

I'm doing an internship and I'm working with databases.
I need to optimize the search time for a
query.
I've already made a modification, but I can't
figure out if I'm saving time compared to the old one.

I'm working on an Oracle database with the
TOAD tool. Is there a way to time the
execution of a query? If so, what is it?

Thank you in advance

Cheers, Mr Jo

3 answers

shaibi
 
There is also another general solution for people who want to use the ORACLE SQLPLUS utility.

Here is a very simple example:

SQL> select tname from tab;
no rows selected

SQL> Set Timing On

SQL> select tname from tab;
no rows selected
Elapsed: 00:00:00.00

Tarik
11
Simon
 
Thank you Tarik.
0
zaggg
 
Thank you for your help.
0
firejoke Posted messages 20 Status Member 12
 
Well, I actually saw that in one place there is a
little square well hidden that tells me the time
taken for the execution of the request
Thanks anyway

@+ Mr Jo
6
Erik Lallemand
 
It is certainly too late for the internship since the question was raised in 2004, but just in case for visitors with a similar issue:

TOAD can indeed display the execution time of a query in the status bar (at the bottom left of the results window of a query). However, there is a more effective way to optimize the execution time of a query.

The EXPLAIN PLAN function of Oracle is utilized in TOAD via an icon representing an ambulance or by using the keyboard shortcut CTRL+e or in the "SQL Editor" menu. EXPLAIN PLAN details the execution plan of SQL queries. In other words, this function shows us each step of the query execution with an associated computation "cost." The higher the cost, the longer the step will take to execute. Thus, EXPLAIN PLAN does not show us the actual execution time of a query (which depends on many factors such as the database load or the presence of the query in the Oracle database pool) but EXPLAIN PLAN shows us which parts of the query are efficient or which require modification.

Sincerely,

E. Lallemand
0
Youssra
 
Thank you for your explanation.
0
Reda
 
Thank you Mr. Lallemand
0
ilham
 
Thank you, it’s really helpful.
0
sebsauvage Posted messages 33284 Registration date   Status Moderator Last intervention   15 684
 
Under Oracle, I don't remember, but there are profiling tools (probably not accessible under TOAD, you need to do a bit of command line).

RTFM.
Search in the Oracle documentation.
2