High Performance MySQL_ Optimization, Backups, and Replication (3rd ed.) [Schwartz, Zaitsev & Tkachenko 2012-04-02].pdf

(16249 KB) Pobierz
THIRD EDITION
High Performance MySQL
Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko
Beijing
Cambridge
Farnham
Köln
Sebastopol
Tokyo
High Performance MySQL, Third Edition
by Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko
Copyright © 2012 Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or
corporate@oreilly.com.
Editor:
Andy Oram
Production Editor:
Holly Bauer
Proofreader:
Rachel Head
March 2004:
June 2008:
March 2012:
First Edition.
Second Edition.
Third Edition.
Indexer:
Jay Marchand
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Rebecca Demarest
Revision History for the Third Edition:
2012-03-01
First release
See
http://oreilly.com/catalog/errata.csp?isbn=9781449314286
for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc.
High Performance MySQL,
the image of a sparrow hawk, and related trade dress
are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
ISBN: 978-1-449-31428-6
[LSI]
1330630256
Table of Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
1. MySQL Architecture and History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
MySQL’s Logical Architecture
Connection Management and Security
Optimization and Execution
Concurrency Control
Read/Write Locks
Lock Granularity
Transactions
Isolation Levels
Deadlocks
Transaction Logging
Transactions in MySQL
Multiversion Concurrency Control
MySQL’s Storage Engines
The InnoDB Engine
The MyISAM Engine
Other Built-in MySQL Engines
Third-Party Storage Engines
Selecting the Right Engine
Table Conversions
A MySQL Timeline
MySQL’s Development Model
Summary
1
2
3
3
4
4
6
7
9
10
10
12
13
15
17
19
21
24
28
29
33
34
2. Benchmarking MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Why Benchmark?
Benchmarking Strategies
35
37
iii
Zgłoś jeśli naruszono regulamin