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

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
P
Privacy International News Feed
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
Know Your Adversary
Know Your Adversary
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
Intezer
博客园 - Franky
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
The Hacker News
The Hacker News
K
Kaspersky official blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tailwind CSS Blog
Project Zero
Project Zero
T
Tor Project blog
B
Blog RSS Feed
Recorded Future
Recorded Future
Scott Helme
Scott Helme
美团技术团队
V
V2EX
V
Visual Studio Blog
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
D
DataBreaches.Net
The Register - Security
The Register - Security
M
MIT News - Artificial intelligence
L
LangChain Blog
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园_首页
P
Privacy & Cybersecurity Law Blog

博客园 - 最坏是单飞

[转载]启用IIS的Gzip压缩功能 javascript判断IFRAME是否加载完成 - 最坏是单飞 - 博客园 Cookie注入是怎样产生的 判断记录是否存在 exists 和 top 1 要比 count 快 国外网站设计与浏览习惯 从一个错误提示引出SQL中in和or的问题。 CSS中 link与@import的区别 firefox3.0上安装google toolbar的问题 ASP.NET中常用的26个优化性能方法 INSERT 失败,因为下列 SET 选项的设置不正确: 'ARITHABORT' 背英语单词的捷径 提高sql server性能的几种方法 Windows下配置Apache支持PHP windows Server mysql的root密码忘记修复方法 sb.5252.ws恶意注入解决方法 asp调用存储过程返回值为空解决方案 - 最坏是单飞 - 博客园 如何在SQL Sever中建立索引? 解决ASP.NET中Type.GetType方法总返回空的问题 - 最坏是单飞 - 博客园 验证视图状态 MAC 失败
select时尽可能少使用as对性能很有好处
最坏是单飞 · 2008-05-10 · via 博客园 - 最坏是单飞

今天突然突然网站有个页面打开贼慢,基本就开不了了
总是超时。。心说,怎么可能,已经尽量优化了啊。。再说数据量也不大也就20万
心里很不爽,就打开页面去看。。
哇,NND,这页面谁做的?

竟然都是 as as as啊啊啊啊啊啊啊啊啊啊啊啊啊
下面说下select中优化的两个小环节

1.尽量少用或不用as
如:selelct province+city as city from products
这样检索的虽然很方便可以得到数据。。
但是as后性能会大大折扣

本人用一个3万数据的表测试 [content] 字段为ntext型,[companyname]为nvarchar(50)

测试语句select companyname as companyname,[content] as 'content' from companys

执行结果为

4:48
5:00
4:32

而去掉了as后select companyname,[content]  from companys
执行结果为

2:45
2:48
2:40

虽然只是一个简单的测试,但是执行结果可以说明速度的差距