Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PL/SQL开发人员中的查询执行时间_Sql_Plsql_Plsqldeveloper - Fatal编程技术网

PL/SQL开发人员中的查询执行时间

PL/SQL开发人员中的查询执行时间,sql,plsql,plsqldeveloper,Sql,Plsql,Plsqldeveloper,我正在PL/SQLDeveloper中运行查询。如何在PL/sql中查找sql查询的运行时间。我正在查询特定的表。像 select * from table_name where customer_id=1; select * from movie_table where movie_id=8; 当我使用PL/SQL时,我想知道查询的运行时间 谢谢,非常感谢您的帮助。我认为您可以使用dbms\u实用程序。获取时间功能 l_start := dbms_utility.get_time; sel

我正在PL/SQLDeveloper中运行查询。如何在PL/sql中查找sql查询的运行时间。我正在查询特定的表。像

select * from table_name where customer_id=1;

select * from movie_table where movie_id=8;
当我使用PL/SQL时,我想知道查询的运行时间


谢谢,非常感谢您的帮助。

我认为您可以使用dbms\u实用程序。获取时间功能

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);

简而言之,类似这样的事情。

最简单的方法是通过@Hamidreza的链接:

set timing on;
select * from table_name where customer_id=1;

执行时间将显示在所选记录的下方。

示例中没有PL/SQL请在每次查询之前和之后从dual中选择sysdate。如果您想从等式中删除编译时间,请确保每个查询运行两次。请查看它是否只在count上运行。当customer\u id=1时,它对select*from table\u name不起作用;并且它只对表_name中的select count(*)有效;如果您阅读@Hamidreza提到的整个页面,您将看到一个非常简单的解决问题的方法。谢谢您的回复。我在SQL窗口中进行了尝试,但没有成功。您是否在SQL窗口中执行它并将其添加到PL/SQL函数中?