Do you view database applications as military campaigns?
Do you see data as row upon row upon row of enemy columns to be winnowed down and slashed away?
SQL veteran Stéphane Faroult does.
In The Art of SQL, Stéphane deals with SQL performance through the lens of Sun Tzu's venerable treatise, The Art of War. Database design is preparation for a military campaign, program design is strategy, and each database access is a tactical engagement of the enemy.
Stéphane's way of looking at SQL performance may be unconventional and unique, but he's dead serious about writing good SQL and using SQL well. In The Art of SQL, you'll find many examples from the trenches of real life, as Stéphane shows the importance of:
• Incorporating design for performance into your database and application from the very beginning. "The single largest contributory factor to poor performance is a design that is wrong."
• Thinking beyond individual SQL statements. "Focus on the overall task to be achieved. Good SQL can't save a poor process."
• Understanding what you are indexing and why you are indexing it. "Too many indexes is the mark of an uncertain design.”
Stéphane also provides concrete advice to help you cement your position. His discussion of the nine common query scenarios and their performance implications will soon have you slashing through your own enemy columns. The chapter on trees will help you see head and shoulders over enemy hierarchies. And when you find yourself surrounded by a database not of your own design, the chapter on stratagems will help you punch through the enemy lines to a solution.
Stéphane Faroult operates the database consultancy RoughSea Ltd. and has a passion for helping clients get the most performance from their database investment. His experience with SQL goes back to 1983. He wrote Oracle France's very first performance and tuning course in 1987.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A performance-tuning classic that frames SQL mastery as military strategy, teaching you to design databases and write queries with the discipline of a campaign planner—ideal for developers, DBAs, and architects who want to move beyond syntax and think about why SQL performs the way it does.
【Book Arc】
- **Opening (~0%–10%)**: The book sets its philosophical stage, borrowing Sun Tzu's *The Art of War* to argue that database design is the "preparation" for performance, program design is "strategy," and each query is a "tactical engagement." It establishes the core thesis: poor performance is almost always a design problem, not a coding problem.
- **Early (~10%–30%)**: Faroult shifts from metaphor to method, emphasizing that performance must be baked in from the start—not bolted on later. He stresses thinking beyond individual SQL statements to the overall task, warning that "good SQL can't save a poor process," and introduces the idea that indexing is a deliberate act of design, not a reflex.
- **Middle (~30%–60%)**: The heart of the book delivers concrete, real-world examples ("from the trenches") covering the nine common query scenarios and their performance implications. This section is practical and scenario-driven, showing how different query patterns behave under different data distributions and access paths.
- **Late (~60%–85%)**: A dedicated chapter on trees helps readers handle hierarchical data structures—a notoriously tricky area—by showing how to model and query them efficiently. This is where the "see head and shoulders over enemy hierarchies" advice from the blurb gets its full treatment.
- **Ending (~85%–100%)**: The book closes with "stratagems"—tactical workarounds and clever approaches for surviving databases you didn't design. This is the rescue manual for legacy systems, offering ways to "punch through enemy lines" when you're surrounded by someone else's schema.
【Key Takeaways】
- **Design is the primary performance lever** (Early): The single largest contributor to poor performance is a wrong design, not bad SQL syntax. This reframes tuning as an architectural concern, not a query-level fix.
- **Think in tasks, not statements** (Early): Focusing on the overall process—not individual queries—is essential. A well-written SQL statement cannot save a poorly designed workflow, so evaluate performance at the task level.
- **Indexing is a design decision, not a default** (Early): "Too many indexes is the mark of an uncertain design." Indexes should be justified by the queries they serve, not added preemptively; over-indexing signals a lack of clarity about access patterns.
- **Nine query scenarios cover most real-world cases** (Middle): The book's practical core categorizes common query patterns and their performance implications, giving readers a diagnostic framework to anticipate how the database will behave before running the query.
- **Hierarchical data requires special handling** (Late): Trees and hierarchies are a recurring pain point; the book provides modeling and querying strategies that let you navigate nested data without sacrificing performance.
- **Legacy databases demand stratagems** (Ending): When you inherit a poorly designed schema, you need tactical workarounds—not just theory—to extract acceptable performance. This chapter is the practical payoff for anyone stuck with someone else's mistakes.
- **Performance is a campaign, not a skirmish** (Throughout): The military metaphor isn't decoration—it's a reminder that every query is part of a larger battle. Winning means planning the whole engagement, from schema to process to execution.
【Reading Tips】
- **Skim the opening chapters** if you're already convinced that design matters; the Sun Tzu framing is engaging but the real value starts with the nine query scenarios in the middle.
- **Deep-read the nine query scenarios** (Middle): This is the book's meat. Take notes on each pattern and test them against your own workload—they're meant to be a diagnostic checklist.
- **Treat the trees chapter as a reference** (Late): Hierarchical data is complex; don't expect to absorb it in one pass. Use it when you actually face a tree problem.
- **Save the stratagems chapter for legacy work** (Ending): If you're designing new systems, this chapter is less urgent; if you're maintaining old ones, it's gold. Read it when you need it.
- **Watch for the "why" behind each example**: Faroult isn't just showing you what works—he's showing you why it works, which is what makes the advice transferable to your own databases.
【Coverage Limits】
The excerpts cover the book's framing, its core thesis on design and indexing, the nine query scenarios, the trees chapter, and the stratagems for legacy systems. They do not include detailed code examples, specific SQL syntax, or the full content of individual chapters.
Excerpt 1
书名: The Art of SQL (Stephane Faroult Peter Robson) (Z-Library) 作者: Stephane Faroult, Peter Robson Do you view database applications as military campaigns? Do...
France's very first performance and tuning course in 1987. The Art of SQL While heeding the profit of my counsel, avail yourself also of any helpful circums...
l sales department: (800) 998-9938 or corporate@oreilly.com. Editor: Jonathan Gennick Production Editors: Jamie Peppard and Marlowe Shaeffer Copyeditor: Nanc...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
The Art of SQL (Stephane Faroult Peter Robson)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
The Art of SQL (Stephane Faroult Peter Robson)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment