惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 深渊野鱼

Framework7 链接重新回来之后,页面数据不重新获取,或者pageinit不重新执行 海关单一窗口程序出现网络/MQ问题后自动修复处理 IE JQuery 多Tab iframe 关闭Tab导致光标丢失 win7 64bit 尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行,将出现此问题 Commitment definition *N not valid for open XXX CPF4326 排查 PowerDesigner之逆向工程SQLServer注意事项 Paypal IPN 天敏SDK2500开发小计 Oracle在windows2003按星期几export的bat文件 - 深渊野鱼 - 博客园 虚拟主机权限之log4net Norton我错怪了你啊~~ 两个iFrame同时打开 - 深渊野鱼 - 博客园 如何向远程系统提交命令? RUNRMTCMD命令使用 OS/400与UNIX功能相似的部分命令 关于文件的ShareODP和USROPN 在5250上面实现复制粘贴 如何以某一关键字快速搜索AS/400 中的Message file 如何查看QTEMP的内容?可以查看别人的QTEMP的
OracleClient之诡异现象
深渊野鱼 · 2008-09-02 · via 博客园 - 深渊野鱼

对于SQL语句
select nvl(to_char(floor(avg((apfndtm-apdldtm)*24*3600))),0) from emflib.eqapypf 
 where apydat >= 20080902 and apydat <= 20080902 and apcfmfg ='C' and apapyfg='A' and  apytim >= 090000 and apytim <= 173000 AND apdeal >= 0 and apntg3 = 0 and apctg4='FANGXN'

如果使用参数化的
速度慢
select nvl(to_char(floor(avg((apfndtm-apdldtm)*24*3600))),0) from emflib.eqapypf 
 where apydat >= :apydat1 and apydat <= :apydat2 and apcfmfg =:apcfmfg and apapyfg=:apapyfg and  apytim >= :apytim1
 and apytim <= :apytim2 AND apdeal >= :apdeal and apntg3 = :apntg3 and apctg4=:apctg4

如下这条,少了一个条件,速度倒还可以
select nvl(to_char(floor(avg((apfndtm-apdldtm)*24*3600))),0) from emflib.eqapypf 
 where apydat >= :apydat1 and apydat <= :apydat2 and apcfmfg =:apcfmfg and apapyfg=:apapyfg and  apytim >= :apytim1
 and apytim <= :apytim2 AND apdeal >= :apdeal and apntg3 = :apntg3

如果把SQL改成
select nvl(to_char(floor(avg((apfndtm-apdldtm)*24*3600))),0) from emflib.eqapypf 
 where apydat >= :apydat1 and apydat <= :apydat2 and apcfmfg =:apcfmfg and apapyfg=:apapyfg and  apytim >= :apytim1
 and apytim <= :apytim2 AND apdeal >= :apdeal and apntg3 = :apntg3  and apctg4='FANGXN'
那么速度也是暴快,真是汗,有些搞不明白为何如此。数据分布
    apctg4         count(*)
1    HUANGJF       106
2    ZHANGYJ       117
3    LINLIJU       2
4    WEISQ         53
5    ZHANGDC       28
6    FANGXN        217
7    LDWANGL       166
8    LINYZ         166
9    SHIXY         184
10    SHAONH        163
11    LIYY          160
12    LDCHENWF      9

根据经验估计,虽然是全部的SQL参数,但是SQL访问计划可能因为数据的分布或者SQL的统计信息的不及时,倒是ORACLE使用全表扫描,而使用直接SQL则可以使其又归回正确的轨道。不过看来,额滴ORACLE功底还是不够深,如果有人晓得,烦请告知原因,实在是没有精力挖那么深啊