Reputation: 55
I'm running queries in PL/SQL Developer. How to find out the running time of sql query in PL/SQL. I am querying specific tables. Like
select * from table_name where customer_id=1;
select * from movie_table where movie_id=8;
While i am using PL/SQL, i want to know the query running time.
Thanks, your help is very much appreciated.
Upvotes: 4
Views: 15099
Reputation: 20804
The simplest way to do this, courtesy of @Hamidreza's link, is like this:
set timing on;
select * from table_name where customer_id=1;
The execution time will appear below the records selected.
Upvotes: 10
Reputation: 1731
I think you can use dbms_utility.get_time function.
l_start := dbms_utility.get_time;
select * from table_name where customer_id=1;
select * from movie_table where movie_id=8;
l_end := dbms_utility.get_time;
l_diff := (l_end-l_start)/100;
dbms_output.put_line('Overall Time: '|| l_diff);
Something like this, in brief.
Upvotes: 0