SQL query execution time calculation
Solved
firejoke
Posted messages
20
Status
Member
-
zaggg -
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
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
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
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
Simon
Thank you Tarik.
zaggg
Thank you for your help.
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
little square well hidden that tells me the time
taken for the execution of the request
Thanks anyway
@+ Mr Jo
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
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