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

推荐订阅源

有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
F
Full Disclosure
C
Check Point Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
博客园 - Franky
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
博客园 - 司徒正美
博客园_首页
云风的 BLOG
云风的 BLOG
L
LINUX DO - 最新话题
Jina AI
Jina AI
Latest news
Latest news
L
LINUX DO - 热门话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
T
Tenable Blog
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
S
Securelist
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
J
Java Code Geeks
T
Threatpost
The Register - Security
The Register - Security
G
Google Developers Blog
Know Your Adversary
Know Your Adversary
T
Tailwind CSS Blog

博客园 - 深渊野鱼

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功底还是不够深,如果有人晓得,烦请告知原因,实在是没有精力挖那么深啊