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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
T
Threatpost
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
O
OpenAI News
P
Palo Alto Networks Blog
美团技术团队
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
量子位
L
Lohrmann on Cybersecurity
G
GRAHAM CLULEY
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Know Your Adversary
Know Your Adversary
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Simon Willison's Weblog
Simon Willison's Weblog
宝玉的分享
宝玉的分享
PCI Perspectives
PCI Perspectives
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
S
Security @ Cisco Blogs
S
Schneier on Security
B
Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Cloudflare Blog
AWS News Blog
AWS News Blog
IT之家
IT之家
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
H
Heimdal Security Blog
I
Intezer
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
W
WeLiveSecurity

博客园 - 水寒

C++ string 详解 (转)Cstring转char、string、int等数据类型的方法 (转)进程通信(用户自定义消息,用户注册消息,windows剪贴板,WM_COPY, 内存映射,对目标进程的内存) ACE WSA Startup not initialized 问题 21个值得深思的故事! C++内存管理详解 下载Eclipse解压后运行出现问题,出现了jvm terminated.Exit code=-1的错误 Java虚拟机(JVM)中的内存设置详解 每天读一遍,慢慢的你就变了 可以有效改进项目管理技能的十个过程 再次写给我们这些浮躁的程序员 vbcrlf常数 vc字符串函数大全 C++sprintf()函数 UDP组播 C#简单组播示例 一个字符转换引发的问题!诡异..... 再看字节对齐! C++虚函数表解析(转)
sqlite 索引优化方法
水寒 · 2011-05-29 · via 博客园 - 水寒

本文摘自:http://www.cnblogs.com/analyzer/articles/1400122.html

速度测试结果:

1) select count(*) from t1,t3 where t1.word2=t3.word2;
很慢(t3.word2上没有索引)
2) select count(*) from t3,t1 where t1.word2=t3.word2;
很慢(t1.word2上没有独立索引)
3) select count(*) from t1,t2 where t1.word2=t2.word2;
很快(t2.word2上有索引)
4) select count(*) from t2,t1 where t1.word2=t2.word2;
很慢(t1.word2上没有独立索引)
5) select count(*) from t1,t2 where t1.num=t2.num;
很快(t2.num上有索引)
6) select count(*) from t2,t1 where t1.num=t2.num;
很快(t1的复合索引中,第一个列是num)
7) select count(*) from t1,t3 where t1.num=t3.num;
很慢(t3.num上没有索引)
8) select count(*) from t3,t1 where t1.num=t3.num;
很快(t1的复合索引中,第一个列是num)

结论:

1、索引可以大大加快查询速度

2、当有交叉查询时,from a,b两个表,取决于b表是否有索引

3、当b上的索引不是独立索引时,查询速度取决于非独立索引的第一个字段