高性能MySQL

出版時間:2012-6  出版社:東南大學出版社  作者:(美)施瓦茲,(美)扎伊采夫,(美)特卡申科 著  頁數(shù):793  字數(shù):1013000  
Tag標簽:無  

前言

  We wrote this book to serve the needs of not just the MySQL application developer but also the MySQL database administrator. We assume that you are already relatively experienced with MySQL. We also assume some experience with general system ad ministration, networking, and Unix-like operating systems.  The second edition of this book presented a lot of information to readers, but no book can provide complete coverage of a topic. Between the second and third editions, we took notes, on literally thousands of interesting problems we'd solved or seen others solve. When we started to outline the third edition, it became clear that not only would full coverage of these topics require three to five thousand pages, but the book still wouldn't be complete. After reflecting on this problem, we realized that the second edition's emphasis on deep coverage was actually self-limiting, in the sense that it often didn't teach readers how to think about MySQL.  As a result, this third edition has a different focus from the second edition. We still convey a lot of information, and we still emphasize the same goals, such as reliability and correctness. But we've also tried to imbue the book with a deeper purpose: we want fo teach the principles of why MySQL works as it does, not just the facts about how it works. We've included more illustrative stories and case studies, which demonstrate the principles in action. We build on these to try to answer questions such as "Given MySQL's internal architecture and operation, what practical effects arise in real usage?Why do those effects matter? How do they make MySQL well suited (or not well suited) for particular needs?"  Ultimately, we hope that your knowledge of MySQL's internals will help you in situa tions beyond the scope of this book. And we hope that your newfound insight will help you to learn and practice a methodical approach to designing, maintaining, and trou bleshooting systems that are built on MySQL.  How This Book Is Organized  We fit a lot of complicated topics into this book. Here, we explain how we put them together in an order that makes them easier to learn.  A Broad Overview  Chapter 1, MySQL Architecture and History is dedicated to the basics--things you'll need to be familiar with before you dig in deeply. You need to understand how MySQL is organized before you'll be able to use it effectively. This chapter explains MySQL's architecture and key facts about its storage engines. It helps you get up to speed if you aren't familiar with some of the fundamentals of a relational database, including transactions. This chapter will also be useful if this book is your introduction to MySQL but you're already familiar with another database, such as Oracle. We also include a bit of historical context: the changes to'MySQL over time, recent ownership changes, and where we think it's headed.  Building a Solid Foundation  The early chapters cover material we hope you'll reference over and over as you use MySQL.  Chapter 2, Benchmarking MySQL discusses the basics of benchmarking--that is, determining what sort of workload your server can handle, how fast it can perform certain tasks, and so on. Benchmarking is an essential skill for evaluating how the server behaves under load, but it's also important to know when it's not useful.  Chapter 3, Profiling Server Performance introduces you to the response time-oriented approach we take to troubleshooting and diagnosing server performance problems.This framework has proven essential to solving some of the most puzzling cases we've seen. Although you might choose to modify our approach (we developed it by modilying Cary Millsap's approach, after all), we hope you'll avoid the pitfalls of not having any method at all.  In Chapters 4 through 6, we introduce three topics that together form the foundation for a good logical and physical database design. In Chapter 4, Optimizing Schema and Data Types, we cover the various nuances of data types and table design. Chapter 5,Indexing for High Performance extends the discussion to indexes--that is, physical database design. A firm understanding of indexes and how to use them well is essential for using MySQL effective'y, so you'll probably find yourself returning to this chapter repeatedly. And Chapter 6, Query Performance Optimization wraps the topics together by explaining how MySQL executes queries and how you can take advantage of its query optimizer's strengths. This chapter also presents specific examples of many Common classes of queries, illustrating where MySQL does a good job and how to transform queries into forms that use its strengths.  Up to this point, we've covered the basic topics that apply to any database: tables,indexes, data, and queries. Chapter 7, Advanced MySQL Features goes beyond the basics and shows you how MySQL's advanced features work. We examine topics such as partkioning, storedprocedures, triggers, and character sets. MySQL's implementation of these features is different from other databases, and a good-understanding of them can open up new opportunities for performance gains that you might not have thought about otherwise.  Configuring Your Application  The next two chapters discuss how to make MySQL, your application, and your hard ware workwell together. In Chapter 8, Optimizing Server Settings, we discuss how you can configure MySQL to make the most of your hardware and to be reliable and robust. Chapter 9, Operating System and Hardware Optimization explains how to get the most out of your operating system and hardware. We discuss solid-state storage in depth, and we suggest hardware configurations that might provide better performance for larger-scale applications.  Both chapters explore MySQL internals to some degree. This is a recurring theme that continues all the way through the appendixes: learn how it works internally, and you'll be empowered to understand and reason about the consequences:  MySQL as an Infrastructure Component  MySQL doesn't exist in a vacuum. It's part of an overall application stack, and you'll need to build a robust overall architecture for your application. The next set of chapters is about how to do that.  In Chapter 10, Replication, we discuss MySQL's killer feature: the ability to set up multiple servers that all stay in sync with a master server's changes. Unfortunately,replication is perhaps MySQL's most troublesome feature for some people. This doesn't have to be the case, and we show you how to ensure that it keeps runni.ng well.Chapter 11, Scaling MySQL discusses what scalability is (it's not the same thing as performance), why applications and systems don't scale, and what to do about it. If you do it right, you can scale MySQL to suit nearly any purpose. Chapter 12, High Availability delves into a related-but-distinct topic: how to ensure that MySQL stays hp and functions smoothly. In Chapter 13, MySQL in the Cloud, you'll learn about what's different when you run MySQL in cloud computing environments.

內(nèi)容概要

  本書中,你將學到與MySQL數(shù)據(jù)庫模式、索引和查詢設計相關的所有高級技巧。通過使用這些技巧,你將能夠對。MySQL數(shù)據(jù)庫服務器、操作系統(tǒng)和硬件進行調優(yōu)以發(fā)揮它們的最大潛力。這本指南同時也提供了通過復制、負載均衡、高可用性及故障轉移等技術對應用進行擴展的安全實用方法。
《高性能MySQL(影印版第3版)由Baron Schwartz、Peter Zaitsev、 Vadim
Tkachenko著。在第三版中更新了MysQL數(shù)據(jù)庫和InnoDB存儲引擎在性能、特性和工具等相關領域取得的最新進展,不僅通過大量的特定示例講解了MySQL數(shù)據(jù)庫如何工作,同時也圍繞MysQL數(shù)據(jù)庫的設計原則,采用生動的故事和案例研究的形式解釋了其對應的工作原理。本書教給讀者如何采用MySQL的方式進行思考。

作者簡介

作者:(美國)施瓦茲(Baron Scbwartz) (美國)扎伊采夫(Peter Zaitsev) (美國)特卡申科(Vadim Tkacbenko)  施瓦茲(Schwartz B.),是Percona公司的首席性能架構師。他的主要工作是通過創(chuàng)建一系列工具和技術來提高MySQL數(shù)據(jù)庫的易用性和可靠性。 扎伊采夫(zaitsev P.),是Percona公司的首席執(zhí)行官和聯(lián)合創(chuàng)始人之一。作為一名數(shù)據(jù)庫內(nèi)核、計算機硬件和應用擴展技術領域的專家,他管理著MysQL團隊內(nèi)部的高性能技術組直到2006年。 特卡申科(Tkachenko V.)是Percona公司的首席技術官和聯(lián)合創(chuàng)始人之一。他領導著公司的開發(fā)團隊先后開發(fā)了Percona服務器、Percona XtraDB集群和Percona XtraBackup工具等產(chǎn)品。

書籍目錄

Foreword
Preface
1. MySQL Architecture and History
2. Benchmarking MySQL
3. Profiling Server Performance
4. Optimizing Schematic and Data Types
5. Indexing for High Performance
6. Query Performance Optimization
7. Advanced MySQL Features
8. Optimizing Server Setting
9. Operating System and Hardware Optimization
10. Replication
11. Scaling MySQL
12. High Availability
13. MySQL in the Cloud
14. Application-Level Optimization
15. Backup and Recovery
16. Tools for MySQL Use
A. Forks and Variants of MySQL
B. MySQL Server Status
C. Traferring Large Files
D. Using EXPLAIN

章節(jié)摘錄

版權頁:   插圖:   Too many columns MySQL's storage engine API works by copying rows between the server and the storage engine in a row buffer format;the server then decodes the buffer into col-umns.But it can be costly to turn the row buffer into the row data structure with the decoded columns.MylSAM's fixed row format actually matches the server's row format exactly,so no conversion is needed.However,MylSAM's variable row format and InnoDB's row format always require conversion.The cost of this con-version depends on the number of columns.We discovered that this can become expensive when we investigated an issue with high CPU consumption for a cus-tomer with extremely wide tables (hundreds of columns),even though only a few columns were actually used.If you're planning for hundreds of columns,be aware that the server's performance characteristics will be a bit different. Too many joins The so-called entity-attribute-value (EAV) design pattern is a classic case of a uni-versally bad design pattern that especially doesn't work well in MySQL.MySQL has a limitation of 61 tables per join,and EAV databases require many self-joins. We've seen more than a few EAV databases eventually exceed this limit.Even at many fewer joins than 61,however,the cost of planning and optimizing the query can become problematic for MySQL.As a rough rule of thumb,it's better to have a dozen or fewer tables per query if you need queries to execute very fast with high concurrency. The all-powerful ENUM Beware of overusing ENUM.Here's an example we saw: CREATE TABLE ...( country enum('','0','1','2',...,'31') The schema was sprinkled liberally with this pattern.This would probably be a questionable design decision in any database with an enumerated value type,be-cause it really should be an integer that is foreign-keyed to a "dictionary" or "lookup" table anyway.But in MySQL,you can't add a new country to the list without an ALTER TABLE,which is a blocking operation in MySQL 5.0 and earlier,and even in 5.1 and newer if you add the value anywhere but at the end of the list.

媒體關注與評論

  “同本書的前幾版相比,第三版是一本更加棒的書。這幾位作者是唯一具有資格寫這本書的人。我將繼續(xù)向他們學習,并希望你也能抽出時間這樣做。”   ——Mark Callaghan Facebook軟件工程師

圖書封面

圖書標簽Tags

評論、評分、閱讀與下載


    高性能MySQL PDF格式下載


用戶評論 (總計27條)

 
 

  •   這個是英文的影印版,本來想弄本中文的看看的。。
  •   09年9月,我買了這本書的第二版,也是英文版,愛不釋手,希望這第三版 會更好~~
  •   新版加入了云計算相關的內(nèi)容,雖然是英文原版,但看著也不是很累。只是書籍的紙張,感覺有點粗糙了。
  •   英文版,英文不好的可以等翻譯版出來
  •   全是英文,看上去有中麻辣辣的感覺呀~很厚的一本書,對于學計算機的來說很不錯喜歡~里面的紙張一般吧,但是搞活動還是蠻劃算的!
  •   正在學習中,好厚的一本書,質量感覺沒有那么好
  •   還是比較簡單易懂的,就是云計算那章有點暈,一些名詞挺糾結的。。
  •   書的內(nèi)容很好,學到很多東西
  •   之前看過電子版的中文的本想買本書做手冊使結果買了個英文版的看著好吃力哈哈內(nèi)容還是很不錯的
  •   書很好,很受用!也鍛煉了英文。
  •   還沒怎么看,書很不錯
  •   挺喜歡這本書,書本身印刷質量不錯,送貨速度不錯。
  •   看過了,還可以,值得好好學習一下
  •   比較懶,還差3章沒有看完,收獲很大
  •   詳細的介紹了Mysql的性能測試、內(nèi)部機制、SQL優(yōu)化、Index、Master Slave部署
  •   書挺好,值得仔細研究。
  •   如果你有英語基礎的話,就選擇這本書吧 ,你可以得到很多。目前看了幾章,之后再追回復。
  •   剛看了前幾張, 收獲很多, 得經(jīng)常翻閱。
  •   但是紙張偏暗 外表紅色有點山寨。 還是沒有機械工業(yè)出版社的影印版來的講究。但是只有這個出版社現(xiàn)在有這款書。還算出的快 這個價錢,我還是很推薦的
  •   經(jīng)典書籍還是要看影音版的,值得收藏
  •   好書,就是英文版,不過大學生讀無壓力,建議學數(shù)據(jù)庫的人都讀一讀
  •   畢竟是影印版的,要求也不高,自己清晰,沒錯就行。中文版的大致看了一遍,感覺有些翻譯的不好。看不明白,所以買本原本的比對著看。這本書可算得上是MYSQL的經(jīng)典書籍啊,不過對于我這種初學者,有些部分還是不適用的。只能等以后慢慢體會了。
  •   朋友說不錯,值得看一下
  •   不錯,了解mysql的好書
  •   居然買了本英文版書!
  •   紙質一般,內(nèi)容應該不錯
  •   書蠻好的~~
 

250萬本中文圖書簡介、評論、評分,PDF格式免費下載。 第一圖書網(wǎng) 手機版

京ICP備13047387號-7