按年被提到
20102011 · 33 次2026
开源书›数据库·No.11

Use The Index, Luke!

SQL 性能解析:用好索引
Markus Winand

面向开发者讲数据库索引和 SQL 查询性能

免费阅读 ↗
被推荐 · 134 人首次 2010-08-20 · 最近 2026-07-08官方免费在线(版权保留,作者或出版社免费放出)
134不同的人
119活跃月份
52有推荐的月份
208讨论串

Markus Winand 写的在线教程,从开发者角度讲数据库索引如何存储、查询如何用到索引,以及where 条件、排序、分页、连接等写法对性能的影响。内容不绑定某一种数据库,同时标出各家数据库的差异。作者另有同主题的纸质书,这个网站是免费在线版。和泛泛的 SQL 入门不同,它只盯着性能这一个主题讲透。

HN 为什么推荐它

HN 上的人认为它是讲数据库索引最好的资源之一,说开发者几乎必读;常被引用来解释聚簇索引,以及用 keyset 分页代替 OFFSET 的做法。

难度 2 / 5约 12 小时
适合谁

写 SQL、关心查询性能的后端开发者

读之前最好知道
1基本 SQL 查询
2关系数据库的基本概念

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1先读索引的内部结构和 where 子句那几章,这是全书基础
  2. 2边读边在自己用的数据库上查看执行计划,验证例子
  3. 3分页、排序等专题可以遇到问题时单独翻阅
  4. 4和自己数据库的官方文档对照,注意各家的差异

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
强烈推荐stuffihavemade · 2011-09

“It's the best resource that I've seen with respect to databases and indexing.”

强烈推荐,是见过讲数据库和索引最好的资源
The Joy of Indexing原评论 ↗
强烈推荐daigoba66 · 2013-11

“Use The Index, Luke! is a great online book (free) targeted at programmers and developers. It's practically required reading in my opinion.”

强烈推荐这本免费在线书,几乎是开发者必读
Why You Should Never Use MongoDB原评论 ↗
强烈推荐olavgg · 2015-11

“I highly recommend his "No to offset" tutorial Use The Index, Luke!”

强烈推荐其“No to offset”教程
Modern SQL: With – Organize Complex Queries原评论 ↗
强烈推荐dguaraglia · 2016-08

“I can't recommend the "Use The Index, Luke"[1] tutorial, and the accompanying book "SQL Performance Explained" by Markus Winand, enough.”

强烈推荐这个教程和配套书 SQL Performance Explained
PostgreSQL Index Internals原评论 ↗
强烈推荐Dangeranger · 2016-11

“The list is missing Use The Index, Luke! and (链接) which are some of the very best resources out there for SQL in general.”

指出清单漏了它,是 SQL 最好的资源之一
Over 50 Educational Resources to Learn SQL and Relational Database Management原评论 ↗
推荐bockris · 2013-01

“is a good resource once you know the basics.”

认为懂基础之后它是不错的资源
Ask HN: What is the best way to learn SQL原评论 ↗
看全部 20 条 →
推荐Negitivefrags · 2013-11

“This is a really good resource for understanding how the queries you do relate to the actual actions that the database engine takes.”

推荐它,帮助理解查询如何对应数据库引擎的实际操作
Why You Should Never Use MongoDB原评论 ↗
推荐Maxious · 2014-01

“Use The Index, Luke! helps when you deal with performance issues. The examples can be altered for your particular SQL server including postgres.”

推荐它解决性能问题,示例可改用于 Postgres
Ask HN: Any decent postgreSQL tutorial for a newbie原评论 ↗
推荐lukaseder · 2014-04

“And this excellent SQL blog:”

称赞它是出色的 SQL 博客
Best resources for learning Java, JDeveloper and SQL原评论 ↗
推荐glogla · 2015-04

“I think Markus (2) explains this much better than I do, so I'll just link his text.”

认为作者讲得更清楚,直接引用作者的原文
PostgreSQL vs. MS SQL Server原评论 ↗
推荐collyw · 2015-07

“If you aren't sure, this site here is an excellent resource.”

推荐这个站点,用来检查查询是否用好了索引
Ask HN: As a junior developer, how do I learn to better architect software?原评论 ↗
推荐DBCerigo · 2016-02

“Not Postgres, but I also found this significantly (if not more) enlightening while I was building my first RDB using SQLite Use The Index, Luke!”

说用 SQLite 建第一个数据库时,它同样让人豁然开朗
PostgreSQL Indexes: First principles原评论 ↗
推荐dspillett · 2016-04

“See Use The Index, Luke! as a good run down of the whys and wherefores of clustered indexes.”

推荐它来了解 clustered index 的来龙去脉
Design better databases原评论 ↗
推荐BenoitP · 2016-04

“[1] Use The Index, Luke! is a very good resource for this.”

认为它是讲这个话题的很好资源
Urban Myths about SQL (2015)原评论 ↗
推荐deathanatos · 2016-07

“I have to again recommend the excellent "Pagination done the Right Way" presentation[1] from Use the Index, Luke (an equally excellent site).”

再次推荐其“Pagination done the Right Way”演讲
Microsoft REST API Guidelines原评论 ↗
推荐dsp1234 · 2016-12

“I have found that Use The Index, Luke is a good reference when looking at optimizations.”

把它当作做优化时的好参考
Techniques for Microsoft SQL database design and optimization原评论 ↗
推荐adamnemecek · 2017-01

“you should check out this site Use The Index, Luke! or a book by the same author (链接)”

建议去看这个站点或作者的书,了解索引原理
How Does the SQL Server Query Optimizer Work?原评论 ↗
推荐koolba · 2017-02

“See here for the real way to handle paging for large result sets: Use The Index, Luke!”

拿它说明大结果集分页的正确做法
Why LINQ beats SQL原评论 ↗
推荐javitury · 2017-02

“Both this guide and Use The Index Luke seem to be good resources.”

认为它和另一份指南都是不错的资源
Unofficial MySQL 8.0 Optimizer Guide原评论 ↗
推荐zie · 2017-05

“I'd suggest avoiding window functions for pagination.. see Use The Index, Luke! as one method.”

建议分页别用 window functions,拿它作替代方法
PostgreSQL 10 Beta 1 Released原评论 ↗