高性能MySQL

出版時(shí)間:2012-6  出版社:東南大學(xué)出版社  作者:(美)施瓦茲,(美)扎伊采夫,(美)特卡申科 著  頁(yè)數(shù):793  字?jǐn)?shù):1013000  
Tag標(biāo)簽:無(wú)  

前言

  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)容概要

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

作者簡(jiǎn)介

作者:(美國(guó))施瓦茲(Baron Scbwartz) (美國(guó))扎伊采夫(Peter Zaitsev) (美國(guó))特卡申科(Vadim Tkacbenko)  施瓦茲(Schwartz B.),是Percona公司的首席性能架構(gòu)師。他的主要工作是通過(guò)創(chuàng)建一系列工具和技術(shù)來(lái)提高M(jìn)ySQL數(shù)據(jù)庫(kù)的易用性和可靠性。 扎伊采夫(zaitsev P.),是Percona公司的首席執(zhí)行官和聯(lián)合創(chuàng)始人之一。作為一名數(shù)據(jù)庫(kù)內(nèi)核、計(jì)算機(jī)硬件和應(yīng)用擴(kuò)展技術(shù)領(lǐng)域的專家,他管理著MysQL團(tuán)隊(duì)內(nèi)部的高性能技術(shù)組直到2006年。 特卡申科(Tkachenko V.)是Percona公司的首席技術(shù)官和聯(lián)合創(chuàng)始人之一。他領(lǐng)導(dǎo)著公司的開發(fā)團(tuán)隊(duì)先后開發(fā)了Percona服務(wù)器、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é)摘錄

版權(quán)頁(yè):   插圖:   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.

媒體關(guān)注與評(píng)論

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

圖書封面

圖書標(biāo)簽Tags

無(wú)

評(píng)論、評(píng)分、閱讀與下載


    高性能MySQL PDF格式下載


用戶評(píng)論 (總計(jì)27條)

 
 

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

250萬(wàn)本中文圖書簡(jiǎn)介、評(píng)論、評(píng)分,PDF格式免費(fèi)下載。 第一圖書網(wǎng) 手機(jī)版

京ICP備13047387號(hào)-7