oracle 数据库中,应用程序里的连接探测语句的正确使用 http://blog.csdn.net/msdnchina/article/details/38513765 在很多程序里边,连接探测(或者连接检测)语句,都是用的select sysdate from dual; 这是典型的“只要功能实现,不管性能如何”的写法。其实
oracle 数据库中,应用程序里的连接探测语句的正确使用http://blog.csdn.net/msdnchina/article/details/38513765
在很多程序里边,连接探测(或者连接检测)语句,都是用的select sysdate from dual;下面说一下 select sysdate from dual; 作为连接探测语句的害处:
1.增加数据库的parse负担:
这一点可以从 awr报告的“SQL ordered by Parse Calls ”可以看到。(以下基于10.2.0.5)Parse Calls Executions % Total Parses SQL Id SQL Module SQL Text 3000 3000 15% aqswdefrgthy JDBC Thin Client select sysdate from dual;
例2: 以下语句不用绑定变量但是也不会被认为是literal SQL,因为这个语句可以被多次执行共享。 SELECT sysdate FROM dual;
The SYSDATE and SYSTIMESTAMP function simply performs a system-call to the Operating System to get the time (a "gettimeofday" call).