SlideShare a Scribd company logo
Visit https://ebookultra.com to download the full version and
explore more ebooks or textbooks
High Performance MySQL Optimization Backups
Replication and More Second Edition Schwartz
_____ Click the link below to download _____
https://ebookultra.com/download/high-performance-mysql-
optimization-backups-replication-and-more-second-edition-
schwartz/
Explore and download more ebooks or textbooks at ebookultra.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
High Availability MySQL Cookbook 1st Edition Alex Davies
https://ebookultra.com/download/high-availability-mysql-cookbook-1st-
edition-alex-davies/
The High Performance Planner Brendon Burchard
https://ebookultra.com/download/the-high-performance-planner-brendon-
burchard/
Pro IOS Apps Performance Optimization and Tuning 1st
Edition Khang Vo
https://ebookultra.com/download/pro-ios-apps-performance-optimization-
and-tuning-1st-edition-khang-vo/
Julia High performance 1st Edition Avik Sengupta
https://ebookultra.com/download/julia-high-performance-1st-edition-
avik-sengupta/
High Performance Plastics 2011 1st Edition Ismithers
https://ebookultra.com/download/high-performance-plastics-2011-1st-
edition-ismithers/
High performance options trading 1st Edition Leonard Yates
https://ebookultra.com/download/high-performance-options-trading-1st-
edition-leonard-yates/
High Performance Fibres 1st Edition J.W.S. Hearle (Eds.)
https://ebookultra.com/download/high-performance-fibres-1st-edition-j-
w-s-hearle-eds/
Improving Service Quality in the Global Economy Achieving
High Performance in Public and Private Sectors Second
Edition Michael Milakovich
https://ebookultra.com/download/improving-service-quality-in-the-
global-economy-achieving-high-performance-in-public-and-private-
sectors-second-edition-michael-milakovich/
High Performance Apparel Materials Development and
Applications 1st Edition John Mcloughlin
https://ebookultra.com/download/high-performance-apparel-materials-
development-and-applications-1st-edition-john-mcloughlin/
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
High Performance MySQL Optimization Backups
Replication and More Second Edition Schwartz Digital
Instant Download
Author(s): Schwartz, Baron, Zaitsev, Peter, Tkachenko, Vadim, Zawodny,
Jeremy D., Lentz, Arjen, Balling, Derek J.
ISBN(s): 9780596101718, 0596101716
Edition: Second
File Details: PDF, 5.63 MB
Year: 2008
Language: english
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
High Performance MySQL
Other Microsoft .NET resources from O’Reilly
Related titles Managing and Using MySQL
MySQL Cookbook™
MySQL Pocket Reference
MySQL Reference Manual
Learning PHP
PHP 5 Essentials
PHP Cookbook™
Practical PostgreSQL
Programming PHP
SQL Tuning
Web Database Applications
with PHP and MySQL
.NET Books
Resource Center
dotnet.oreilly.com is a complete catalog of O’Reilly’s books on
.NET and related technologies, including sample chapters and
code examples.
ONDotnet.com provides independent coverage of fundamental,
interoperable, and emerging Microsoft .NET programming and
web services technologies.
Conferences O’Reilly Media bring diverse innovators together to nurture the
ideas that spark revolutionary industries. We specialize in docu-
menting the latest tools and systems, translating the innovator’s
knowledge into useful skills for those in the trenches. Visit con-
ferences.oreilly.com for our upcoming events.
Safari Bookshelf (safari.oreilly.com) is the premier online refer-
ence library for programmers and IT professionals. Conduct
searches across more than 1,000 books. Subscribers can zero in
on answers to time-critical questions in a matter of seconds.
Read the books on your Bookshelf from cover to cover or sim-
ply flip to the page you need. Try it today for free.
High Performance MySQL
SECOND EDITION
Baron Schwartz, Peter Zaitsev, Vadim Tkachenko,
Jeremy D. Zawodny, Arjen Lentz,
and Derek J. Balling
Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo
High Performance MySQL, Second Edition
by Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny,
Arjen Lentz, and Derek J. Balling
Copyright © 2008 O’Reilly Media, Inc. 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 (safari.oreilly.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Editor: Andy Oram
Production Editor: Loranah Dimant
Copyeditor: Rachel Wheeler
Proofreader: Loranah Dimant
Indexer: Angela Howard
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrators: Jessamyn Read
Printing History:
April 2004: First Edition.
June 2008: Second Edition.
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 contained herein.
This book uses RepKover™
, a durable and flexible lay-flat binding.
ISBN: 978-0-596-10171-8
[M]
v
Table of Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1. MySQL Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
MySQL’s Logical Architecture 1
Concurrency Control 3
Transactions 6
Multiversion Concurrency Control 12
MySQL’s Storage Engines 14
2. Finding Bottlenecks: Benchmarking and Profiling . . . . . . . . . . . . . . . . . . . . . 32
Why Benchmark? 33
Benchmarking Strategies 33
Benchmarking Tactics 37
Benchmarking Tools 42
Benchmarking Examples 44
Profiling 54
Operating System Profiling 76
3. Schema Optimization and Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Choosing Optimal Data Types 80
Indexing Basics 95
Indexing Strategies for High Performance 106
An Indexing Case Study 131
Index and Table Maintenance 136
Normalization and Denormalization 139
Speeding Up ALTER TABLE 145
Notes on Storage Engines 149
vi | Table of Contents
4. Query Performance Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Slow Query Basics: Optimize Data Access 152
Ways to Restructure Queries 157
Query Execution Basics 160
Limitations of the MySQL Query Optimizer 179
Optimizing Specific Types of Queries 188
Query Optimizer Hints 195
User-Defined Variables 198
5. Advanced MySQL Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
The MySQL Query Cache 204
Storing Code Inside MySQL 217
Cursors 224
Prepared Statements 225
User-Defined Functions 230
Views 231
Character Sets and Collations 237
Full-Text Searching 244
Foreign Key Constraints 252
Merge Tables and Partitioning 253
Distributed (XA) Transactions 262
6. Optimizing Server Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Configuration Basics 266
General Tuning 271
Tuning MySQL’s I/O Behavior 281
Tuning MySQL Concurrency 295
Workload-Based Tuning 298
Tuning Per-Connection Settings 304
7. Operating System and Hardware Optimization . . . . . . . . . . . . . . . . . . . . . . . 305
What Limits MySQL’s Performance? 306
How to Select CPUs for MySQL 306
Balancing Memory and Disk Resources 309
Choosing Hardware for a Slave 317
RAID Performance Optimization 317
Storage Area Networks and Network-Attached Storage 325
Using Multiple Disk Volumes 326
Network Configuration 328
Table of Contents | vii
Choosing an Operating System 330
Choosing a Filesystem 331
Threading 334
Swapping 334
Operating System Status 336
8. Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Replication Overview 343
Setting Up Replication 347
Replication Under the Hood 355
Replication Topologies 362
Replication and Capacity Planning 376
Replication Administration and Maintenance 378
Replication Problems and Solutions 388
How Fast Is Replication? 405
The Future of MySQL Replication 407
9. Scaling and High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Terminology 410
Scaling MySQL 412
Load Balancing 436
High Availability 447
10. Application-Level Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Application Performance Overview 457
Web Server Issues 460
Caching 463
Extending MySQL 470
Alternatives to MySQL 471
11. Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Overview 473
Considerations and Tradeoffs 477
Managing and Backing Up Binary Logs 486
Backing Up Data 488
Recovering from a Backup 499
Backup and Recovery Speed 510
Backup Tools 511
Scripting Backups 518
viii | Table of Contents
12. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Terminology 521
Account Basics 522
Operating System Security 541
Network Security 542
Data Encryption 550
MySQL in a chrooted Environment 554
13. MySQL Server Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
System Variables 557
SHOW STATUS 558
SHOW INNODB STATUS 565
SHOW PROCESSLIST 578
SHOW MUTEX STATUS 579
Replication Status 580
INFORMATION_SCHEMA 581
14. Tools for High Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Interface Tools 583
Monitoring Tools 585
Analysis Tools 595
MySQL Utilities 598
Sources of Further Information 601
A. Transferring Large Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
B. Using EXPLAIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
C. Using Sphinx with MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
D. Debugging Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
ix
Foreword1
I have known Peter, Vadim, and Arjen a long time and have witnessed their long his-
tory of both using MySQL for their own projects and tuning it for a lot of different
high-profile customers. On his side, Baron has written client software that enhances
the usability of MySQL.
The authors’ backgrounds are clearly reflected in their complete reworking in this
second edition of High Performance MySQL: Optimizations, Replication, Backups,
and More. It’s not just a book that tells you how to optimize your work to use
MySQL better than ever before. The authors have done considerable extra work, car-
rying out and publishing benchmark results to prove their points. This will give you,
the reader, a lot of valuable insight into MySQL’s inner workings that you can’t eas-
ily find in any other book. In turn, that will allow you to avoid a lot of mistakes in
the future that can lead to suboptimal performance.
I recommend this book both to new users of MySQL who have played with the
server a little and now are ready to write their first real applications, and to experi-
enced users who already have well-tuned MySQL-based applications but need to get
“a little more” out of them.
—Michael Widenius
March 2008
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
xi
Preface2
We had several goals in mind for this book. Many of them were derived from think-
ing about that mythical perfect MySQL book that none of us had read but that we
kept looking for on bookstore shelves. Others came from a lot of experience helping
other users put MySQL to work in their environments.
We wanted a book that wasn’t just a SQL primer. We wanted a book with a title that
didn’t start or end in some arbitrary time frame (“...in Thirty Days,” “Seven Days To
a Better...”) and didn’t talk down to the reader. Most of all, we wanted a book that
would help you take your skills to the next level and build fast, reliable systems with
MySQL—one that would answer questions like “How can I set up a cluster of
MySQL servers capable of handling millions upon millions of queries and ensure that
things keep running even if a couple of the servers die?”
We decided to write a book that focused not just on the needs of the MySQL appli-
cation developer but also on the rigorous demands of the MySQL administrator,
who needs to keep the system up and running no matter what the programmers or
users may throw at the server. Having said that, we assume that you are already rela-
tively experienced with MySQL and, ideally, have read an introductory book on it.
We also assume some experience with general system administration, networking,
and Unix-like operating systems.
This revised and expanded second edition includes deeper coverage of all the topics
in the first edition and many new topics as well. This is partly a response to the
changes that have taken place since the book was first published: MySQL is a much
larger and more complex piece of software now. Just as importantly, its popularity
has exploded. The MySQL community has grown much larger, and big corporations
are now adopting MySQL for their mission-critical applications. Since the first edi-
tion, MySQL has become recognized as ready for the enterprise.* People are also
* We think this phrase is mostly marketing fluff, but it seems to convey a sense of importance to a lot of people.
xii | Preface
using it more and more in applications that are exposed to the Internet, where down-
time and other problems cannot be concealed or tolerated.
As a result, this second edition has a slightly different focus than the first edition. We
emphasize reliability and correctness just as much as performance, in part because we
have used MySQL ourselves for applications where significant amounts of money are
riding on the database server. We also have deep experience in web applications, where
MySQL has become very popular. The second edition speaks to the expanded world of
MySQL, which didn’t exist in the same way when the first edition was written.
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, 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 orga-
nized before you’ll be able to use it effectively. This chapter explains MySQL’s archi-
tecture 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.
Building a Solid Foundation
The next four chapters cover material you’ll find yourself referencing over and over
as you use MySQL.
Chapter 2, Finding Bottlenecks: Benchmarking and Profiling, discusses the basics of
benchmarking and profiling—that is, determining what sort of workload your server
can handle, how fast it can perform certain tasks, and so on. You’ll want to bench-
mark your application both before and after any major change, so you can judge how
effective your changes are. What seems to be a positive change may turn out to be a
negative one under real-world stress, and you’ll never know what’s really causing
poor performance unless you measure it accurately.
In Chapter 3, Schema Optimization and Indexing, we cover the various nuances of
data types, table design, and indexes. A well-designed schema helps MySQL per-
form much better, and many of the things we discuss in later chapters hinge on how
well your application puts MySQL’s indexes to work. A firm understanding of
indexes and how to use them well is essential for using MySQL effectively, so you’ll
probably find yourself returning to this chapter repeatedly.
Preface | xiii
Chapter 4, Query Performance Optimization, explains how MySQL executes queries
and how you can take advantage of its query optimizer’s strengths. Having a firm
grasp of how the query optimizer works will do wonders for your queries and will
help you understand indexes better. (Indexing and query optimization are sort of a
chicken-and-egg problem; reading Chapter 3 again after you read Chapter 4 might be
useful.) This chapter also presents specific examples of virtually all common classes
of queries, illustrating where MySQL does a good job and how to transform queries
into forms that take advantage of its strengths.
Up to this point, we’ve covered the basic topics that apply to any database: tables,
indexes, data, and queries. Chapter 5, Advanced MySQL Features, goes beyond the
basics and shows you how MySQL’s advanced features work. We examine the query
cache, stored procedures, triggers, character sets, and more. MySQL’s implementa-
tion 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.
Tuning Your Application
The next two chapters discuss how to make changes to improve your MySQL-based
application’s performance.
In Chapter 6, Optimizing Server Settings, we discuss how you can tune MySQL to
make the most of your hardware and to work as well as possible for your specific
application. Chapter 7, Operating System and Hardware Optimization, explains how
to get the most out of your operating system and hardware. We also suggest hard-
ware configurations that may provide better performance for larger-scale applications.
Scaling Upward After Making Changes
One server isn’t always enough. In Chapter 8, Replication, we discuss replication—
that is, getting your data copied automatically to multiple servers. When combined
with the scaling, load-balancing, and high availability lessons in Chapter 9, Scaling
and High Availability, this will provide you with the groundwork for scaling your
applications as large as you need them to be.
An application that runs on a large-scale MySQL backend often provides significant
opportunities for optimization in the application itself. There are better and worse ways
to design large applications. While this isn’t the primary focus of the book, we don’t
want you to spend all your time concentrating on MySQL. Chapter 10, Application-
Level Optimization, will help you discover the low-hanging fruit in your overall archi-
tecture, especially if it’s a web application.
xiv | Preface
Making Your Application Reliable
The best-designed, most scalable architecture in the world is no good if it can’t sur-
vive power outages, malicious attacks, application bugs or programmer mistakes,
and other disasters.
In Chapter 11, Backup and Recovery, we discuss various backup and recovery strate-
gies for your MySQL databases. These strategies will help minimize your downtime
in the event of inevitable hardware failure and ensure that your data survives such
catastrophes.
Chapter 12, Security, provides you with a firm grasp of some of the security issues
involved in running a MySQL server. More importantly, we offer many suggestions
to allow you to prevent outside parties from harming the servers you’ve spent all this
time trying to configure and optimize. We explain some of the rarely explored areas
of database security, showing both the benefits and performance impacts of various
practices. Usually, in terms of performance, it pays to keep security policies simple.
Miscellaneous Useful Topics
In the last few chapters and the book’s appendixes, we delve into several topics that
either don’t “fit” in any of the earlier chapters or are referenced often enough in mul-
tiple chapters that they deserve a bit of special attention.
Chapter 13, MySQL Server Status shows you how to inspect your MySQL server.
Knowing how to get status information from the server is important; knowing what
that information means is even more important. We cover SHOW INNODB STATUS in par-
ticular detail, because it provides deep insight into the operations of the InnoDB
transactional storage engine.
Chapter 14, Tools for High Performance covers tools you can use to manage MySQL
more efficiently. These include monitoring and analysis tools, tools that help you
write queries, and so on. This chapter covers the Maatkit tools Baron created, which
can enhance MySQL’s functionality and make your life as a database administrator
easier. It also demonstrates a program called innotop, which Baron wrote as an easy-
to-use interface to what your MySQL server is presently doing. It functions much like
the Unix top command and can be invaluable at all phases of the tuning process to
monitor what’s happening inside MySQL and its storage engines.
Appendix A, Transferring Large Files, shows you how to copy very large files from
place to place efficiently—a must if you are going to manage large volumes of data.
Appendix B, Using EXPLAIN, shows you how to really use and understand the all-
important EXPLAIN command. Appendix C, Using Sphinx with MySQL, is an intro-
duction to Sphinx, a high-performance full-text indexing system that can comple-
ment MySQL’s own abilities. And finally, Appendix D, Debugging Locks, shows you
Preface | xv
how to decipher what’s going on when queries are requesting locks that interfere
with each other.
Software Versions and Availability
MySQL is a moving target. In the years since Jeremy wrote the outline for the first edi-
tion of this book, numerous releases of MySQL have appeared. MySQL 4.1 and 5.0
were available only as alpha versions when the first edition went to press, but these
versions have now been in production for years, and they are the backbone of many of
today’s large online applications. As we completed this second edition, MySQL 5.1
and 6.0 were the bleeding edge instead. (MySQL 5.1 is a release candidate, and 6.0 is
alpha.)
We didn’t rely on one single version of MySQL for this book. Instead, we drew on
our extensive collective knowledge of MySQL in the real world. The core of the book
is focused on MySQL 5.0, because that’s what we consider the “current” version.
Most of our examples assume you’re running some reasonably mature version of
MySQL 5.0, such as MySQL 5.0.40 or newer. We have made an effort to note fea-
tures or functionalities that may not exist in older releases or that may exist only in
the upcoming 5.1 series. However, the definitive reference for mapping features to
specific versions is the MySQL documentation itself. We expect that you’ll find your-
self visiting the annotated online documentation (http://dev.mysql.com/doc/) from
time to time as you read this book.
Another great aspect of MySQL is that it runs on all of today’s popular platforms:
Mac OS X, Windows, GNU/Linux, Solaris, FreeBSD, you name it! However, we are
biased toward GNU/Linux* and other Unix-like operating systems. Windows users
are likely to encounter some differences. For example, file paths are completely dif-
ferent. We also refer to standard Unix command-line utilities; we assume you know
the corresponding commands in Windows.†
Perl is the other rough spot when dealing with MySQL on Windows. MySQL comes
with several useful utilities that are written in Perl, and certain chapters in this book
present example Perl scripts that form the basis of more complex tools you’ll build.
Maatkit is also written in Perl. However, Perl isn’t included with Windows. In order
to use these scripts, you’ll need to download a Windows version of Perl from
ActiveState and install the necessary add-on modules (DBI and DBD::mysql) for
MySQL access.
* To avoid confusion, we refer to Linux when we are writing about the kernel, and GNU/Linux when we are
writing about the whole operating system infrastructure that supports applications.
† You can get Windows-compatible versions of Unix utilities at http://unxutils.sourceforge.net or http://
gnuwin32.sourceforge.net.
xvi | Preface
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Used for new terms, URLs, email addresses, usernames, hostnames, filenames,
file extensions, pathnames, directories, and Unix commands and utilities.
Constant width
Indicates elements of code, configuration options, database and table names,
variables and their values, functions, modules, the contents of files, or the out-
put from commands.
Constant width bold
Shows commands or other text that should be typed literally by the user. Also
used for emphasis in command output.
Constant width italic
Shows text that should be replaced with user-supplied values.
This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
Using Code Examples
This book is here to help you get your job done. In general, you may use the code in
this book in your programs and documentation. You don’t need to contact us for
permission unless you’re reproducing a significant portion of the code. For example,
writing a program that uses several chunks of code from this book doesn’t require
permission. Selling or distributing a CD-ROM of examples from O’Reilly books does
require permission. Answering a question by citing this book and quoting example
code doesn’t require permission. Incorporating a significant amount of example code
from this book into your product’s documentation does require permission.
Examples are maintained on the site http://www.highperfmysql.com and will be
updated there from time to time. We cannot commit, however, to updating and test-
ing the code for every minor release of MySQL.
We appreciate, but don’t require, attribution. An attribution usually includes the
title, author, publisher, and ISBN. For example: “High Performance MySQL: Optimi-
zation, Backups, Replication, and More, Second Edition, by Baron Schwartz et al.
Copyright 2008 O’Reilly Media, Inc., 9780596101718.”
Preface | xvii
If you feel your use of code examples falls outside fair use or the permission given
above, feel free to contact us at permissions@oreilly.com.
Safari® Books Online
When you see a Safari® Books Online icon on the cover of your
favorite technology book, that means the book is available online
through the O’Reilly Network Safari Bookshelf.
Safari offers a solution that’s better than e-books. It’s a virtual library that lets you
easily search thousands of top tech books, cut and paste code samples, download
chapters, and find quick answers when you need the most accurate, current informa-
tion. Try it for free at http://safari.oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any addi-
tional information. You can access this page at:
http://www.oreilly.com/catalog/9780596101718/
To comment or ask technical questions about this book, send email to:
bookquestions@oreilly.com
For more information about our books, conferences, Resource Centers, and the
O’Reilly Network, see our web site at:
http://www.oreilly.com
You can also get in touch with the authors directly. Baron’s weblog is at http://www.
xaprb.com.
Peter and Vadim maintain two weblogs, the well-established and popular http://www.
mysqlperformanceblog.com and the more recent http://www.webscalingblog.com. You
can find the web site for their company, Percona, at http://www.percona.com.
Arjen’s company, OpenQuery, has a web site at http://openquery.com.au. Arjen also
maintains a weblog at http://arjen-lentz.livejournal.com and a personal site at http://
lentz.com.au.
xviii | Preface
Acknowledgments for the Second Edition
Sphinx developer Andrew Aksyonoff wrote Appendix C, Using Sphinx with MySQL
We’d like to thank him first for his in-depth discussion.
We have received invaluable help from many people while writing this book. It’s
impossible to list everyone who gave us help—we really owe thanks to the entire
MySQL community and everyone at MySQL AB. However, here’s a list of people
who contributed directly, with apologies if we’ve missed anyone: Tobias Asplund,
Igor Babaev, Pascal Borghino, Roland Bouman, Ronald Bradford, Mark Callaghan,
Jeremy Cole, Britt Crawford and the HiveDB Project, Vasil Dimov, Harrison Fisk,
Florian Haas, Dmitri Joukovski and Zmanda (thanks for the diagram explaining
LVM snapshots), Alan Kasindorf, Sheeri Kritzer Cabral, Marko Makela, Giuseppe
Maxia, Paul McCullagh, B. Keith Murphy, Dhiren Patel, Sergey Petrunia, Alexander
Rubin, Paul Tuckfield, Heikki Tuuri, and Michael “Monty” Widenius.
A special thanks to Andy Oram and Isabel Kunkle, our editor and assistant editor at
O’Reilly, and to Rachel Wheeler, the copyeditor. Thanks also to the rest of the
O’Reilly staff.
From Baron
I would like to thank my wife Lynn Rainville and our dog Carbon. If you’ve written a
book, I’m sure you know how grateful I am to them. I also owe a huge debt of grati-
tude to Alan Rimm-Kaufman and my colleagues at the Rimm-Kaufman Group for
their support and encouragement during this project. Thanks to Peter, Vadim, and
Arjen for giving me the opportunity to make this dream come true. And thanks to
Jeremy and Derek for breaking the trail for us.
From Peter
I’ve been doing MySQL performance and scaling presentations, training, and con-
sulting for years, and I’ve always wanted to reach a wider audience, so I was very
excited when Andy Oram approached me to work on this book. I have not written a
book before, so I wasn’t prepared for how much time and effort it required. We first
started talking about updating the first edition to cover recent versions of MySQL,
but we wanted to add so much material that we ended up rewriting most of the
book.
This book is truly a team effort. Because I was very busy bootstrapping Percona,
Vadim’s and my consulting company, and because English is not my first language,
we all had different roles. I provided the outline and technical content, then I
reviewed the material, revising and extending it as we wrote. When Arjen (the former
head of the MySQL documentation team) joined the project, we began to fill out the
Other documents randomly have
different content
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
The Project Gutenberg eBook of The
Adventures of an Ugly Girl
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Title: The Adventures of an Ugly Girl
Author: Mrs. George Corbett
Release date: October 11, 2018 [eBook #58082]
Language: English
Credits: Produced by Mary Glenn Krause, amsibert, Barry
Abrahamsen,
and the Online Distributed Proofreading Team at
http://www.pgdp.net (This file was produced from
images
generously made available by The Internet
Archive/American
Libraries.)
*** START OF THE PROJECT GUTENBERG EBOOK THE
ADVENTURES OF AN UGLY GIRL ***
High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz
Vol. XI., No. 10. November 18, 1893. Subscription Price, $1.50
THE ADVENTURES OF
AN UGLY GIRL
BY
MRS. GEORGE CORBETT
Author of “When the Sea gives up its Dead,” “Adventures
of a Stowaway,” “A Sailor’s Life,” “The Child
of the Wreck,” “The Mystery of Fellsmere,” “Tom
Penn’s Derelict,” “Adventures of an Amateur Detective,”
“Secrets of a Private Enquiry Office,”
“The Missing Note,” “New Amazonia,” “Adventures
of a Lady Detective,” etc., etc.
Issued Semi-Monthly.
Entered at the Post-Office at New York as second-class matter.
PETER FENELON COLLIER, Publisher, 523 W. 13th St., N.Y.
“WORTH A GUINEA A BOX”
BEECHAM’S
PILLS
CURE
SICK HEADACHE,
DISORDERED LIVER, ETC.
They Act Like Magic on the Vital Organs, Regulating the Secretions,
restoring long lost Complexion, bringing back the Keen Edge of
Appetite, and arousing with the ROSEBUD OF HEALTH the whole
physical energy of the human frame. These Facts are admitted by
thousands, in all classes of Society. Largest Sale in the World.
Covered with a Tasteless & Soluble Coating.
Of all druggists. Price 25 cents a box.
New York Depot, 365 Canal St.
THE ADVENTURES
OF
AN UGLY GIRL
BY
MRS. GEORGE CORBETT
Author of “When the Sea gives up its Dead,” “Adventures of a
Stowaway” “A Sailor’s Life,” “The Child of the Wreck,” “The
Mystery of Fellsmere,” “Tom Penn’s Derelict,” “Adventures
of an Amateur Detective,” “Secrets of a Private Enquiry
Office,” “The Missing Note,” “New Amazonia,” “Adventures
of a Lady Detective,” etc., etc.
Specially written for “Once a Week Library”
Entered according to Act of Congress, in the year 1898 by
Peter Fenelon Collier,
In the Office of the Librarian of Congress at Washington.
All’s Well
that ends well; all who have Coughs, Colds and Throat Troubles are
made well by
Scott’s
Emulsion
of Cod-liver Oil, with hypophosphites of lime and Soda. When lungs
are affected Scott’s Emulsion, if taken in time, prevents
consumption. Physicians, the world over, endorse it.
The consumption germ takes root and grows when the body is weak
and emaciated. The germ passes off when the body is strong.
Prepared by SCOTT & BOWNE, N. Y. Druggists sell it.
THE ADVENTURES OF
AN UGLY GIRL.
CHAPTER I.
“As ithers see us.”—Burns.
“Come, Dora! I shall never be ready, if you don’t make haste. They
will be here in ten minutes, and my hair is not half so nice as it
ought to be, thanks to your carelessness.”
“You are very good to ignore my own claims to attention so
utterly. I have been helping you this half-hour and have barely time
enough left to change my frock. To make my own hair presentable is
impossible now.”
“Why, what does it matter how your hair is dressed, or what sort
of a gown you put on? You may just as well spare your pains, for
unfortunately nothing that you can do seems to mitigate your
ugliness. I’m sure I cannot think where you get it. You are—”
But, somehow, I did not feel inclined to wait for the end of Belle’s
encouraging lecture. Perhaps it was because I was so often treated
to my beautiful elder sister’s homilies that they had lost the spark of
novelty and had acquired a chestnuty flavor. Perhaps I failed to
recognize any generosity in her persistent efforts to nip such latent
buds of vanity as from time to time tried to thrust their poor little
heads above the chill crust of ridicule and contumely. Perhaps I was
really as bad-tempered as I was said to be. Anyhow, my behavior
could not claim to be either quiet or elegant as I stormily quitted
Belle’s room, slamming the door behind me with such violence as to
elicit from my more well-bred sister a little shriek of affected dismay.
So far from feeling sorry that I had given Belle’s nerves a shock, I
wished viciously that her fingers had been jammed in the doorway,
or that something equally disastrous had occurred to take off the
edge of her conceit and self-satisfaction. In the corridor I met my
brother Jerry, of whom I was devotedly fond. But, although he had
evidently some interesting remark to make, I did not stop to speak
to him, but hurried noisily to my own room, where I locked myself
in, and threw myself on the bed, to give way to a storm of sobs and
tears.
“And all for what?” it may be asked. “Surely a spiteful remark from
one sister to another is hardly worth all this display of feeling.” Ah,
well, perhaps one such remark now and then might be treated with
the cool contempt which spiteful utterances deserve. But does the
reader know what it is to be perpetually and persistently snubbed
from one year’s end to the other? Does he realize how hard it must
be for a sensitive and love-craving girl to be reminded that she is
ugly and unattractive? Not reminded once in a way either, but pretty
nearly every day of her life. Or does any one doubt how the heart
must needs ache to see all the love and flattery of friends and
relations alike showered upon a being whom you know to be empty-
headed and frivolous, while everybody seems to regard your plain
exterior as sufficient reason why you should be snubbed and
neglected?
If the reader has ever had any of these experiences, he will the
more readily understand my inability to restrain my tears on the
especial occasion just mentioned. For it really was a very especial
occasion, and I had been more anxious to look well at this particular
moment than I ever remembered to have been in my life. I had
hoped that Belle, just for once in a way, would take a little interest in
my personal appearance, and that she would help me to create as
good an impression as possible upon the newcomer whose advent I
had both dreaded and longed for.
But Belle was too self-engrossed, and too firmly convinced of my
hopeless unpresentability, to give the slightest thought either to me
or to my feelings. Nay, she had even claimed so much of my time in
the task of enhancing her own beauty, that, as we have seen, I had
only a few minutes left for myself, and even this morsel of time was
not utilized by me, as things turned out.
The fact is, I was anxious and overwrought, and Belle’s unkind
speeches had multiplied all day until they had utterly broken my
composure. “Can it really be true,” I wondered in abject misery, “that
nothing I can either do or wear will help to mitigate the first feeling
of repulsion which my new mother must necessarily experience at
the sight of my ugliness?”
The question was of very vital import to me, for I longed for the
advent of at least one sympathetic woman in the house; and when I
heard that my father, now three years a widower, was about to
marry again, I hoped, with a fervor that was nearly akin to agony,
that his second wife would be the friend I so sorely needed. True,
she would be my stepmother, and she would naturally assume the
direction of the household affairs, at once placing the daughters of
the house in a subordinate position. This being the case, I believe it
would have been more orthodox to have railed against the new
invasion, and to have followed the prevailing social custom of
resolving to make life miserable for the woman who had presumed
to step into my mother’s place. But I always was terribly unorthodox
in many things, and, considerably to my father’s surprise, I
expressed my enthusiastic delight at the prospect of having a
stepmother to reign over me.
He need not have been surprised, if he had ever taken the trouble
to understand me. But he was wrapped up in Belle’s charms, and
never looked at me without regretting either my ugliness or my
temper, which all in the house, except dear little Jerry, pronounced
unbearable. And yet I can truthfully say, that if I had experienced
anything approaching to just treatment, I should have been infinitely
sweeter-tempered than my much-bepraised sister, than whom none
could have been more unfeeling to the motherless girl whose heart
ached for a little love. I generally did Belle’s bidding, for she always
contrived to make things unpleasant for me if I rebelled against her
authority. But to Lady Elizabeth Courtney I felt ready to yield the
most devoted service and obedience, if only she would love me just
a little in return; and I had anxiously revolved every means of
creating a favorable impression upon her. I meant to have taken
considerable pains with my toilet, and to have welcomed the home-
coming bride with radiant smiles.
And this was how my good resolves had ended. Just when—after
working hard all day to see that everything was conducive to a warm
and comfortable home-coming—I had begun to hurry through my
toilet, I was summoned to Belle’s aid, with the result that instead of
giving my stepmother a smiling welcome I was up in my own room,
with a face red and swollen with weeping, and a heart full of angry
feeling, when she arrived. Presently I heard a carriage approaching,
and at the same instant Jerry knocked vigorously at my bedroom
door.
“Be quick and come down, Dorrie,” he cried, in an eager, excited
voice. “Papa and Lady Elizabeth are nearly here, and I want you to
run down the avenue with me to meet them.”
“I’m not coming,” I answered, with a sob that was audible to Jerry
and provoked him to quick wrath.
“I knew she would!” he exclaimed. “That horrid Belle’s been at her
tricks again and said something nasty. But don’t let her have the
best of you like that. Don’t you know that you promised to go with
me to meet them, and if you don’t come they won’t believe you are
glad about it.”
“I can’t help it, Jerry,” was my mournful reply. “I look so hideous
just now that I could not possibly face a stranger. Run off quickly
yourself. Say that I have a headache or something of the sort, and
that I shall try to sleep it off. Run now, there’s a dear boy.”
And forthwith Jerry, whose real name, by-the-by, is Gerald
Mortimer Courtney, ran along the corridor, down the wide, shallow
stairs, across the tiled hall, and into the open air, just as the carriage
containing the newly married pair drove into the large graveled
space in which the chestnut avenue terminated. In spite of my
discomfiture and unpresentable appearance, I possessed my due
share of curiosity, and hastily jumped to my feet, crossed the room,
and looked through the window at the prancing horses and elegant
equipage which bore the newcomers. As soon as the carriage
stopped, a liveried footman descended and opened the door with a
flourish. By the time he had let the steps down, Belle and Jerry were
at the carriage door, and I saw Mr. and Lady Elizabeth Courtney get
out and exchange smiles and kisses with my sister and brother, while
I, poor pariah, looked on with hungry eyes and an aching heart, and
bewailed my luck in seeming ill-natured and inhospitable, after all
my efforts to prove the contrary.
Lady Elizabeth, I must explain, had had some love passages with
my father a long time ago. But their youthful desires had been
taught to bow to the demands of fortune and position. Lady
Elizabeth was the daughter of an earl, and could aspire to more
material comforts than could have been provided for her by the
penniless younger son of a country squire. True, the earl had no
money, and what little land was still left him was mortgaged up to
the hilt. But he had many friends who possessed sufficient influence
to pitchfork his four sons into government sinecures. He had a
cousin also, the Duchess of Lyndene, who chaperoned his
handsome, clever daughter through two whole seasons, and
eventually resigned her charge into the care of Samuel Chisholm,
Esquire, once upon a time a shoeblack, now the proud possessor of
twenty thousand a year, all made by the judicious advertisement of
his prize patent blacking.
Upon the whole, the earl’s daughter was supposed to have done
tolerably well for herself, and as her husband’s fortune steadily
increased there was every reason for her to feel satisfied. Even the
incumbrance which she had been compelled to take with the fortune
was not especially disagreeable to her, for Mr. Chisholm was a very
clever man, whose mental and social equipments kept pace with his
fortunes, and, in spite of his low origin and antecedents, he was as
courtly and well-bred as Lady Elizabeth’s nobly-born brothers. The
pair therefore lived harmoniously enough together, at least to
outward seeming, for many years. Then Mr. Chisholm died
somewhat suddenly, and his will was read in due course.
It was during that important ceremony that the unexpectedly
bereaved widow first felt real resentment against her late husband.
For though he had died a millionaire, he had only willed his wife a
life interest of five thousand a year, which was quite a paltry income
compared with the princely revenue she had expected to be hers. To
her father a like fortune was bequeathed, in addition to a sum of
thirty thousand pounds wherewith to redeem his impoverished
estate. The widow’s brothers each received a gift of five thousand
pounds, and to the widow herself was willed all the personal
property of the deceased.
All the rest of his vast fortune was divided among a swarm of poor
relations, whose existence Lady Elizabeth had never acknowledged,
but who no doubt showered blessings on the memory of the dead
man who had thus befriended his own flesh and blood. The Earl of
Greatlands, too, declared himself delighted with his son-in-law’s
generosity. But his daughter did not hesitate to say that she had
been treated shamefully, and at once proclaimed her intention of
resigning the tenancy of the costly London establishment, which it
would be a farce to attempt to keep up on five thousand a year. She
retired to a pretty place in the country, declining to reside with her
father, who, elated by his unwonted prosperity, was actually talking
of taking a young wife to comfort his old age.
My father had, meanwhile, married my mother, whose memory I
adore, for she loved me passionately, and while she lived I was
never humiliated, as was perpetually the case after her death, which
occurred some three years before my story opens. I do not
remember hearing how my father came across Lady Elizabeth again,
but I believe that their early attachment soon reasserted itself, and
though he was much the poorer of the two, and encumbered with
three children, the match was soon arranged.
Although Lady Elizabeth had been dissatisfied with her widow’s
portion she was very much richer than we were, and her coming to
Courtney Grange was likely to be a very important event to the
previous humble inhabitants thereof. In addition to the Grange,
which had been my maternal grandfather’s property, my father had
just six hundred a year, derived partly from what his father had left
him, partly from my mother’s small fortune. Our establishment
consisted of two servants, in addition to the family. Their names
were John and Martha Page. They had never seen any other service
but that of my father and grandfather, and had lived seventeen years
under the same roof before it entered their heads to amalgamate
their interests by marrying. They were quite used to the constant
scraping and economizing which we were compelled to practice, and
did not look upon the arrival of a new mistress as an unmixed
blessing, even though she was bringing a good income with her.
As for Belle, she was quite wild with delight at the gorgeous
prospect which opened itself before her mental vision. London
seasons, presentations at court, halcyon days of brilliant pleasure,
and a swarm of dukes and earls sighing for the honor of her hand.
These were some of the glowing visions in which she indulged.
“And I mean to get into Lady Elizabeth’s good graces, whether I
like her or not,” she informed me. “She can do so much for me if she
likes, and I can be amiability itself when I like. Besides, my looks will
win her over at once. She will soon see what credit I can do to
pretty gowns. As for you, you’ll be lucky if she tolerates you at all.
I’m sure it’s a shame that our family’s reputation for beauty should
suffer as it does through you.” And so on, ad libitum.
Of course, I was not surprised to see her warm, gushing welcome
of my father and his wife, nor to note the glance of surprised
admiration which the latter cast upon Belle and Gerald, for they were
really both very beautiful, and both tall and well-grown, with lovely
golden hair, rich deep blue eyes, and an exquisite complexion, united
to perfect features.
Lady Elizabeth, too, I was sorry to see, was a tall, handsome
woman, who by no means looked her forty years. When I say that I
was sorry to observe this, it must not be imagined that I grudged
her her good looks. But I had had a vague notion that if she were
comparatively plain she would the more easily sympathize with my
troubles, into which no one in the house except Jerry seemed able
to enter. Now my hopes in that direction were upset, and I already
knew instinctively that my own absence was being commented
upon. I saw my father, the very picture of masculine comeliness,
glance up at my window with an angry frown, and I knew almost as
well as if I had been present what Belle and Jerry were saying about
me.
After all, I thought, I had been very foolish to let Belle’s ill-nature
and my own ill-temper spoil my resolve to make Lady Elizabeth’s
home-coming as pleasant as possible. Apart from looks, my
remaining upstairs would have already made me lose ground with
my stepmother. Was it too late, I wondered, to rectify my error, and
make my appearance before dinner was served? Answering the
question in the negative, I resolved to complete my toilet as quickly
as possible, and get over the ordeal of the first meeting without
further loss of time.
So I began operations at once, wondering, while I brushed my
hair, how it was that I was so different to Jerry and Belle. I pulled
faces at my own ugly reflection in the glass, but as that only seemed
to make matters worse, I desisted. But I could not banish the
discontent which enhanced my ugliness, and made it almost perfect
in its own way. Why was I so short and dumpy? I asked myself
vainly. And why was my hair so black, and lank, and scanty? And
how was it that my complexion was more like Thames mud than
anything else? And why was my face covered with freckles? These
freckles I always felt to be an especial aggravation of nature; for
whoever heard of freckles on a dark, sallow skin? And then, how did
it happen that my eyes were of a pale watery-brown hue, while I
had hardly got either eyelashes or eyebrows that were visible? And
why, oh, why! had my nose got that exasperating habit of looking
skyward?
Even as I asked these questions of myself, I felt how hopeless it
was to attempt to answer them. So I abandoned them and tried to
console myself with the reflection that my mouth was well-shaped
and that I had splendid teeth. But then my great red hands obtruded
themselves upon my notice, and blotted out all consciousness of my
redeeming features. I took considerable pains with my hair, and put
on my best dress. Alas! the latter was of a curious brown shade
which somehow only seemed to enhance my ugliness. Belle was
dressed in a dainty pink cambric; but I was never allowed such a
luxury, as it was considered that I was too untidy, and too plain, and
altogether too unsuitable to indulge in pretty things. Besides, we had
to be economical, and as I could never hope to captivate a lover, no
matter how I was dressed, it would have been a shame to waste
money upon my futile adornment. So Belle argued, and I had
hitherto had no choice but to bow to her arguments.
I was at last ready to go downstairs, when once more Jerry came
to look me up.
“Oh, you’re donned up, are you?” he remarked. “And, upon my
word, you’re looking quite spry.”
But I was not to be soothed by such negative flattery as this, and
sternly asked Jerry what he meant by “looking quite spry.”
“Why, spry, you know, spry means—at least, I mean—that you
look as if you were going to a prayer meeting; that is, you look so
prim, and tidy, and straight. But, Dorrie, dear, I like you far better as
you were this morning, and as you generally are. You look real jolly
then.”
Saying this, Jerry kissed me warmly, and I forthwith resigned
myself to the hopelessness of attempting to improve my
appearance. This morning I had worn an old lilac print that had
originally been made for Belle. It was faded with much washing, and
possessed sundry little adornments in the way of frayed edges and
sleeves out at elbows. Truly, Belle had been right, after all, and it
was sheer folly on my part to rebel against fate, since neither
coaxing nor rebelling seemed to propitiate her. Seeing, therefore,
how stern and uncompromising she was with me, I resolved to take
less notice of her in future, and had no sooner made the resolve
than I began to feel peaceful and self-possessed. What if the gift of
beauty was denied me, had I not many other blessings to be
thankful for? In all my seventeen years of life I had never had
anything but the most robust health, and if my school record was
anything to go by, I possessed a much more valuable property in the
way of brains than Belle did. These should outweigh my physical
defects, and prove my passport to the world’s good graces.
I dare say Jerry was rather surprised to see me suddenly
straighten myself up, and assume a much more cheerful expression.
“What is Lady Elizabeth like?” I asked.
“Looks?”
“No, ways.”
“Well, I take her to be rather a brick, do you know. She was as
pleasant and as much at home with Belle and me as if she had lived
here all her life and had just been off for a holiday. She thinks we
are just like pa, and that is high praise, I should fancy.”
“Very high praise, Jerry. I wonder what she’ll say about me. But it
doesn’t matter. Is dinner nearly served?”
“Yes; but John was grumbling because you hadn’t helped to see
that the table was all right, as you had promised to do.”
“Oh! Poor John. It was a shame of me to forget all about him. I’ll
hurry down now and see what I can do. Come on, Jerry.”
A minute later we were both skipping nimbly downstairs, and
while Jerry, at my earnest request, ran round to the stable to see
how my bull-terrier, Bobby, was progressing, I ran into the kitchen to
make my peace with John and Martha. As Martha was somewhat
sulky, and protested that they had managed very well without me, I
made my way to the dining-room, and began swiftly to re-arrange
the flowers which I had culled for the table earlier in the day. John
looked rather scandalized, and remarked that he thought he knew
how to arrange a table as well as most folks. But I did not heed
John’s grumbling much, for it was his chronic condition, and I had
just completed my little task to my own satisfaction when John rang
the second dinner-bell, the first not having been noticed by me.
Just then Jerry came back.
“Bobby will be all right in a day,” he said, whereat I expressed my
satisfaction, for I had been greatly troubled when poor Bobby had
come limping home with every sign of war about him.
“And, oh!” I said, with sudden remembrance, “what has been
done with the wonderful carriage and pair, and those gorgeous
servants?”
“They went straight home. They belong to the earl. He sent them
to meet Lady Elizabeth at the station. Her own carriages are coming
after she has seen what arrangements it will be best to make here. I
fancy she doesn’t like the place very much.”
“Not like the Grange?” I exclaimed indignantly. “Why, she must be
a veritable heathen—”
“Dora, I regret that you should think fit to behave so badly, but
must demand a little of your attention, while I introduce you to the
notice of Lady Elizabeth Courtney.”
Was ever luck like mine? Here had I quite lost sight of the fact
that my father and his wife might enter the room at any time, and
they had actually overheard me speak in tones of contempt of the
one woman on earth whom I wished to propitiate! I turned hurriedly
round, and saw my father, looking very irate, Lady Elizabeth, looking
coldly critical, and Belle, looking ill-naturedly triumphant.
“I beg your pardon, papa. I did not mean it,” I stammered.
“No, I do not suppose you did mean us to overhear you,” he
replied sternly. “But I have no doubt that you had resolved to be
intensely disagreeable, and I tell you plainly that I will not have it.
You see, my love,” he said, turning to his wife, “you will have a little
temper and self-will to deal with, but I am sure you will know how to
compel it to keep within due bounds.”
What could I do or say after that? Nothing, of course, and I sat
miserably through the whole meal, while all but Jerry laughed and
talked as if quite unconscious of my presence. I would fain have
escaped to my own room when the dinner was over. But my father
had taken it into his head that I merely wanted to be obstinate and
disagreeable, and suggested that I should spend an hour in the
drawing-room. I accordingly took refuge at the piano. But my music
was so melancholy that I am not surprised that I was asked to
desist, for, when you come to think of it, “Killigrew’s Lament,” and
“The Dead March in Saul,” haven’t a very bridal sound about them.
So far Lady Elizabeth had not spoken directly to me, and
whenever my eyes wandered in her direction, I could see that her
glance was very critical, but I could not be sure that it was quite so
disapproving as I had expected. Yet, although I neither spoke, nor
was spoken to, there was no constraint between the others, for my
father and Lady Courtney were both good conversationalists, and
Belle could chatter by the hour, provided the talk was kept at a
suitably frivolous level. Jerry, after being petted and praised a little,
had been sent to bed primed with a quartet of kisses, and jubilant in
the possession of a bright sovereign which papa had given to him in
honor of the advent of a new mistress at Courtney Grange.
“Belle, dear, suppose you play us one of your pretty pieces,” said
my father. Whereupon I vacated the music-stool, and took refuge
near the big oriel window which overlooked the orchard, and which
was my especial delight. For it was like a small room in itself, and I
did not feel quite so lost among its cozy, faded draperies as I did in
any other part of our drawing-room, which always seemed to me to
be much too large for the furniture that was in it. Belle, after a great
deal of fidgeting and looking round at herself, to make sure that her
dress was falling in graceful folds, struck a few chords on what had
been a very fine piano in its day, but which even I, who was partial
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookultra.com

More Related Content

Similar to High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz (20)

PDF
Mysql In A Nutshell In A Nutshell Oreilly Second Edition Russell Dyer
atchaaslaney
 
PDF
The Proper Care and Feeding of MySQL Databases
Dave Stokes
 
PDF
Mysql Cookbook Solutions For Database Developers And Administrators 4th Editi...
ahlrotdeiko
 
PDF
Mysql Cookbook Solutions For Database Developers And Administrators 4th Editi...
ahlrotdeiko
 
PPT
High Performance Mysql
liufabin 66688
 
PDF
Learning Mysql Seyed Mm Saied Tahaghoghi Hugh Williams
margasmst
 
PPT
MySQL Performance Tuning at COSCUP 2014
Ryusuke Kajiyama
 
PDF
MySQL Enterprise Monitor
Mario Beck
 
PDF
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Dave Stokes
 
PDF
Mysql Cookbook Solutions For Database Developers And Administrators Dubois
raysseycan
 
PDF
High Availability MySQL Cookbook 1st Edition Alex Davies
ajarnikto
 
PPTX
Mysql introduction and the components etc
saitejapeddaoggu
 
PPTX
MySQL 8.0 in a nutshell
OracleMySQL
 
PPTX
State ofdolphin short
Mandy Ang
 
PDF
MySQL Webinar Series 4/4 - Manage & tune
Mark Swarbrick
 
PDF
MySQL Enterprise Monitor
Mark Swarbrick
 
ODP
The care and feeding of a MySQL database
Dave Stokes
 
PDF
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
Tommy Lee
 
PDF
01 demystifying mysq-lfororacledbaanddeveloperv1
Ivan Ma
 
PPTX
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
Dave Stokes
 
Mysql In A Nutshell In A Nutshell Oreilly Second Edition Russell Dyer
atchaaslaney
 
The Proper Care and Feeding of MySQL Databases
Dave Stokes
 
Mysql Cookbook Solutions For Database Developers And Administrators 4th Editi...
ahlrotdeiko
 
Mysql Cookbook Solutions For Database Developers And Administrators 4th Editi...
ahlrotdeiko
 
High Performance Mysql
liufabin 66688
 
Learning Mysql Seyed Mm Saied Tahaghoghi Hugh Williams
margasmst
 
MySQL Performance Tuning at COSCUP 2014
Ryusuke Kajiyama
 
MySQL Enterprise Monitor
Mario Beck
 
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Dave Stokes
 
Mysql Cookbook Solutions For Database Developers And Administrators Dubois
raysseycan
 
High Availability MySQL Cookbook 1st Edition Alex Davies
ajarnikto
 
Mysql introduction and the components etc
saitejapeddaoggu
 
MySQL 8.0 in a nutshell
OracleMySQL
 
State ofdolphin short
Mandy Ang
 
MySQL Webinar Series 4/4 - Manage & tune
Mark Swarbrick
 
MySQL Enterprise Monitor
Mark Swarbrick
 
The care and feeding of a MySQL database
Dave Stokes
 
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
Tommy Lee
 
01 demystifying mysq-lfororacledbaanddeveloperv1
Ivan Ma
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
Dave Stokes
 

Recently uploaded (20)

PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
community health nursing question paper 2.pdf
Prince kumar
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
Dimensions of Societal Planning in Commonism
StefanMz
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Ad

High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz

  • 1. Visit https://ebookultra.com to download the full version and explore more ebooks or textbooks High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz _____ Click the link below to download _____ https://ebookultra.com/download/high-performance-mysql- optimization-backups-replication-and-more-second-edition- schwartz/ Explore and download more ebooks or textbooks at ebookultra.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. High Availability MySQL Cookbook 1st Edition Alex Davies https://ebookultra.com/download/high-availability-mysql-cookbook-1st- edition-alex-davies/ The High Performance Planner Brendon Burchard https://ebookultra.com/download/the-high-performance-planner-brendon- burchard/ Pro IOS Apps Performance Optimization and Tuning 1st Edition Khang Vo https://ebookultra.com/download/pro-ios-apps-performance-optimization- and-tuning-1st-edition-khang-vo/ Julia High performance 1st Edition Avik Sengupta https://ebookultra.com/download/julia-high-performance-1st-edition- avik-sengupta/
  • 3. High Performance Plastics 2011 1st Edition Ismithers https://ebookultra.com/download/high-performance-plastics-2011-1st- edition-ismithers/ High performance options trading 1st Edition Leonard Yates https://ebookultra.com/download/high-performance-options-trading-1st- edition-leonard-yates/ High Performance Fibres 1st Edition J.W.S. Hearle (Eds.) https://ebookultra.com/download/high-performance-fibres-1st-edition-j- w-s-hearle-eds/ Improving Service Quality in the Global Economy Achieving High Performance in Public and Private Sectors Second Edition Michael Milakovich https://ebookultra.com/download/improving-service-quality-in-the- global-economy-achieving-high-performance-in-public-and-private- sectors-second-edition-michael-milakovich/ High Performance Apparel Materials Development and Applications 1st Edition John Mcloughlin https://ebookultra.com/download/high-performance-apparel-materials- development-and-applications-1st-edition-john-mcloughlin/
  • 5. High Performance MySQL Optimization Backups Replication and More Second Edition Schwartz Digital Instant Download Author(s): Schwartz, Baron, Zaitsev, Peter, Tkachenko, Vadim, Zawodny, Jeremy D., Lentz, Arjen, Balling, Derek J. ISBN(s): 9780596101718, 0596101716 Edition: Second File Details: PDF, 5.63 MB Year: 2008 Language: english
  • 9. Other Microsoft .NET resources from O’Reilly Related titles Managing and Using MySQL MySQL Cookbook™ MySQL Pocket Reference MySQL Reference Manual Learning PHP PHP 5 Essentials PHP Cookbook™ Practical PostgreSQL Programming PHP SQL Tuning Web Database Applications with PHP and MySQL .NET Books Resource Center dotnet.oreilly.com is a complete catalog of O’Reilly’s books on .NET and related technologies, including sample chapters and code examples. ONDotnet.com provides independent coverage of fundamental, interoperable, and emerging Microsoft .NET programming and web services technologies. Conferences O’Reilly Media bring diverse innovators together to nurture the ideas that spark revolutionary industries. We specialize in docu- menting the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches. Visit con- ferences.oreilly.com for our upcoming events. Safari Bookshelf (safari.oreilly.com) is the premier online refer- ence library for programmers and IT professionals. Conduct searches across more than 1,000 books. Subscribers can zero in on answers to time-critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim- ply flip to the page you need. Try it today for free.
  • 10. High Performance MySQL SECOND EDITION Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, and Derek J. Balling Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo
  • 11. High Performance MySQL, Second Edition by Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, and Derek J. Balling Copyright © 2008 O’Reilly Media, Inc. 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 (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Andy Oram Production Editor: Loranah Dimant Copyeditor: Rachel Wheeler Proofreader: Loranah Dimant Indexer: Angela Howard Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrators: Jessamyn Read Printing History: April 2004: First Edition. June 2008: Second Edition. 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 contained herein. This book uses RepKover™ , a durable and flexible lay-flat binding. ISBN: 978-0-596-10171-8 [M]
  • 12. v Table of Contents Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi 1. MySQL Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 MySQL’s Logical Architecture 1 Concurrency Control 3 Transactions 6 Multiversion Concurrency Control 12 MySQL’s Storage Engines 14 2. Finding Bottlenecks: Benchmarking and Profiling . . . . . . . . . . . . . . . . . . . . . 32 Why Benchmark? 33 Benchmarking Strategies 33 Benchmarking Tactics 37 Benchmarking Tools 42 Benchmarking Examples 44 Profiling 54 Operating System Profiling 76 3. Schema Optimization and Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Choosing Optimal Data Types 80 Indexing Basics 95 Indexing Strategies for High Performance 106 An Indexing Case Study 131 Index and Table Maintenance 136 Normalization and Denormalization 139 Speeding Up ALTER TABLE 145 Notes on Storage Engines 149
  • 13. vi | Table of Contents 4. Query Performance Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Slow Query Basics: Optimize Data Access 152 Ways to Restructure Queries 157 Query Execution Basics 160 Limitations of the MySQL Query Optimizer 179 Optimizing Specific Types of Queries 188 Query Optimizer Hints 195 User-Defined Variables 198 5. Advanced MySQL Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 The MySQL Query Cache 204 Storing Code Inside MySQL 217 Cursors 224 Prepared Statements 225 User-Defined Functions 230 Views 231 Character Sets and Collations 237 Full-Text Searching 244 Foreign Key Constraints 252 Merge Tables and Partitioning 253 Distributed (XA) Transactions 262 6. Optimizing Server Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Configuration Basics 266 General Tuning 271 Tuning MySQL’s I/O Behavior 281 Tuning MySQL Concurrency 295 Workload-Based Tuning 298 Tuning Per-Connection Settings 304 7. Operating System and Hardware Optimization . . . . . . . . . . . . . . . . . . . . . . . 305 What Limits MySQL’s Performance? 306 How to Select CPUs for MySQL 306 Balancing Memory and Disk Resources 309 Choosing Hardware for a Slave 317 RAID Performance Optimization 317 Storage Area Networks and Network-Attached Storage 325 Using Multiple Disk Volumes 326 Network Configuration 328
  • 14. Table of Contents | vii Choosing an Operating System 330 Choosing a Filesystem 331 Threading 334 Swapping 334 Operating System Status 336 8. Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 Replication Overview 343 Setting Up Replication 347 Replication Under the Hood 355 Replication Topologies 362 Replication and Capacity Planning 376 Replication Administration and Maintenance 378 Replication Problems and Solutions 388 How Fast Is Replication? 405 The Future of MySQL Replication 407 9. Scaling and High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Terminology 410 Scaling MySQL 412 Load Balancing 436 High Availability 447 10. Application-Level Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 Application Performance Overview 457 Web Server Issues 460 Caching 463 Extending MySQL 470 Alternatives to MySQL 471 11. Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 Overview 473 Considerations and Tradeoffs 477 Managing and Backing Up Binary Logs 486 Backing Up Data 488 Recovering from a Backup 499 Backup and Recovery Speed 510 Backup Tools 511 Scripting Backups 518
  • 15. viii | Table of Contents 12. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 Terminology 521 Account Basics 522 Operating System Security 541 Network Security 542 Data Encryption 550 MySQL in a chrooted Environment 554 13. MySQL Server Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 System Variables 557 SHOW STATUS 558 SHOW INNODB STATUS 565 SHOW PROCESSLIST 578 SHOW MUTEX STATUS 579 Replication Status 580 INFORMATION_SCHEMA 581 14. Tools for High Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 Interface Tools 583 Monitoring Tools 585 Analysis Tools 595 MySQL Utilities 598 Sources of Further Information 601 A. Transferring Large Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 B. Using EXPLAIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 C. Using Sphinx with MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 D. Debugging Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
  • 16. ix Foreword1 I have known Peter, Vadim, and Arjen a long time and have witnessed their long his- tory of both using MySQL for their own projects and tuning it for a lot of different high-profile customers. On his side, Baron has written client software that enhances the usability of MySQL. The authors’ backgrounds are clearly reflected in their complete reworking in this second edition of High Performance MySQL: Optimizations, Replication, Backups, and More. It’s not just a book that tells you how to optimize your work to use MySQL better than ever before. The authors have done considerable extra work, car- rying out and publishing benchmark results to prove their points. This will give you, the reader, a lot of valuable insight into MySQL’s inner workings that you can’t eas- ily find in any other book. In turn, that will allow you to avoid a lot of mistakes in the future that can lead to suboptimal performance. I recommend this book both to new users of MySQL who have played with the server a little and now are ready to write their first real applications, and to experi- enced users who already have well-tuned MySQL-based applications but need to get “a little more” out of them. —Michael Widenius March 2008
  • 18. xi Preface2 We had several goals in mind for this book. Many of them were derived from think- ing about that mythical perfect MySQL book that none of us had read but that we kept looking for on bookstore shelves. Others came from a lot of experience helping other users put MySQL to work in their environments. We wanted a book that wasn’t just a SQL primer. We wanted a book with a title that didn’t start or end in some arbitrary time frame (“...in Thirty Days,” “Seven Days To a Better...”) and didn’t talk down to the reader. Most of all, we wanted a book that would help you take your skills to the next level and build fast, reliable systems with MySQL—one that would answer questions like “How can I set up a cluster of MySQL servers capable of handling millions upon millions of queries and ensure that things keep running even if a couple of the servers die?” We decided to write a book that focused not just on the needs of the MySQL appli- cation developer but also on the rigorous demands of the MySQL administrator, who needs to keep the system up and running no matter what the programmers or users may throw at the server. Having said that, we assume that you are already rela- tively experienced with MySQL and, ideally, have read an introductory book on it. We also assume some experience with general system administration, networking, and Unix-like operating systems. This revised and expanded second edition includes deeper coverage of all the topics in the first edition and many new topics as well. This is partly a response to the changes that have taken place since the book was first published: MySQL is a much larger and more complex piece of software now. Just as importantly, its popularity has exploded. The MySQL community has grown much larger, and big corporations are now adopting MySQL for their mission-critical applications. Since the first edi- tion, MySQL has become recognized as ready for the enterprise.* People are also * We think this phrase is mostly marketing fluff, but it seems to convey a sense of importance to a lot of people.
  • 19. xii | Preface using it more and more in applications that are exposed to the Internet, where down- time and other problems cannot be concealed or tolerated. As a result, this second edition has a slightly different focus than the first edition. We emphasize reliability and correctness just as much as performance, in part because we have used MySQL ourselves for applications where significant amounts of money are riding on the database server. We also have deep experience in web applications, where MySQL has become very popular. The second edition speaks to the expanded world of MySQL, which didn’t exist in the same way when the first edition was written. 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, 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 orga- nized before you’ll be able to use it effectively. This chapter explains MySQL’s archi- tecture 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. Building a Solid Foundation The next four chapters cover material you’ll find yourself referencing over and over as you use MySQL. Chapter 2, Finding Bottlenecks: Benchmarking and Profiling, discusses the basics of benchmarking and profiling—that is, determining what sort of workload your server can handle, how fast it can perform certain tasks, and so on. You’ll want to bench- mark your application both before and after any major change, so you can judge how effective your changes are. What seems to be a positive change may turn out to be a negative one under real-world stress, and you’ll never know what’s really causing poor performance unless you measure it accurately. In Chapter 3, Schema Optimization and Indexing, we cover the various nuances of data types, table design, and indexes. A well-designed schema helps MySQL per- form much better, and many of the things we discuss in later chapters hinge on how well your application puts MySQL’s indexes to work. A firm understanding of indexes and how to use them well is essential for using MySQL effectively, so you’ll probably find yourself returning to this chapter repeatedly.
  • 20. Preface | xiii Chapter 4, Query Performance Optimization, explains how MySQL executes queries and how you can take advantage of its query optimizer’s strengths. Having a firm grasp of how the query optimizer works will do wonders for your queries and will help you understand indexes better. (Indexing and query optimization are sort of a chicken-and-egg problem; reading Chapter 3 again after you read Chapter 4 might be useful.) This chapter also presents specific examples of virtually all common classes of queries, illustrating where MySQL does a good job and how to transform queries into forms that take advantage of its strengths. Up to this point, we’ve covered the basic topics that apply to any database: tables, indexes, data, and queries. Chapter 5, Advanced MySQL Features, goes beyond the basics and shows you how MySQL’s advanced features work. We examine the query cache, stored procedures, triggers, character sets, and more. MySQL’s implementa- tion 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. Tuning Your Application The next two chapters discuss how to make changes to improve your MySQL-based application’s performance. In Chapter 6, Optimizing Server Settings, we discuss how you can tune MySQL to make the most of your hardware and to work as well as possible for your specific application. Chapter 7, Operating System and Hardware Optimization, explains how to get the most out of your operating system and hardware. We also suggest hard- ware configurations that may provide better performance for larger-scale applications. Scaling Upward After Making Changes One server isn’t always enough. In Chapter 8, Replication, we discuss replication— that is, getting your data copied automatically to multiple servers. When combined with the scaling, load-balancing, and high availability lessons in Chapter 9, Scaling and High Availability, this will provide you with the groundwork for scaling your applications as large as you need them to be. An application that runs on a large-scale MySQL backend often provides significant opportunities for optimization in the application itself. There are better and worse ways to design large applications. While this isn’t the primary focus of the book, we don’t want you to spend all your time concentrating on MySQL. Chapter 10, Application- Level Optimization, will help you discover the low-hanging fruit in your overall archi- tecture, especially if it’s a web application.
  • 21. xiv | Preface Making Your Application Reliable The best-designed, most scalable architecture in the world is no good if it can’t sur- vive power outages, malicious attacks, application bugs or programmer mistakes, and other disasters. In Chapter 11, Backup and Recovery, we discuss various backup and recovery strate- gies for your MySQL databases. These strategies will help minimize your downtime in the event of inevitable hardware failure and ensure that your data survives such catastrophes. Chapter 12, Security, provides you with a firm grasp of some of the security issues involved in running a MySQL server. More importantly, we offer many suggestions to allow you to prevent outside parties from harming the servers you’ve spent all this time trying to configure and optimize. We explain some of the rarely explored areas of database security, showing both the benefits and performance impacts of various practices. Usually, in terms of performance, it pays to keep security policies simple. Miscellaneous Useful Topics In the last few chapters and the book’s appendixes, we delve into several topics that either don’t “fit” in any of the earlier chapters or are referenced often enough in mul- tiple chapters that they deserve a bit of special attention. Chapter 13, MySQL Server Status shows you how to inspect your MySQL server. Knowing how to get status information from the server is important; knowing what that information means is even more important. We cover SHOW INNODB STATUS in par- ticular detail, because it provides deep insight into the operations of the InnoDB transactional storage engine. Chapter 14, Tools for High Performance covers tools you can use to manage MySQL more efficiently. These include monitoring and analysis tools, tools that help you write queries, and so on. This chapter covers the Maatkit tools Baron created, which can enhance MySQL’s functionality and make your life as a database administrator easier. It also demonstrates a program called innotop, which Baron wrote as an easy- to-use interface to what your MySQL server is presently doing. It functions much like the Unix top command and can be invaluable at all phases of the tuning process to monitor what’s happening inside MySQL and its storage engines. Appendix A, Transferring Large Files, shows you how to copy very large files from place to place efficiently—a must if you are going to manage large volumes of data. Appendix B, Using EXPLAIN, shows you how to really use and understand the all- important EXPLAIN command. Appendix C, Using Sphinx with MySQL, is an intro- duction to Sphinx, a high-performance full-text indexing system that can comple- ment MySQL’s own abilities. And finally, Appendix D, Debugging Locks, shows you
  • 22. Preface | xv how to decipher what’s going on when queries are requesting locks that interfere with each other. Software Versions and Availability MySQL is a moving target. In the years since Jeremy wrote the outline for the first edi- tion of this book, numerous releases of MySQL have appeared. MySQL 4.1 and 5.0 were available only as alpha versions when the first edition went to press, but these versions have now been in production for years, and they are the backbone of many of today’s large online applications. As we completed this second edition, MySQL 5.1 and 6.0 were the bleeding edge instead. (MySQL 5.1 is a release candidate, and 6.0 is alpha.) We didn’t rely on one single version of MySQL for this book. Instead, we drew on our extensive collective knowledge of MySQL in the real world. The core of the book is focused on MySQL 5.0, because that’s what we consider the “current” version. Most of our examples assume you’re running some reasonably mature version of MySQL 5.0, such as MySQL 5.0.40 or newer. We have made an effort to note fea- tures or functionalities that may not exist in older releases or that may exist only in the upcoming 5.1 series. However, the definitive reference for mapping features to specific versions is the MySQL documentation itself. We expect that you’ll find your- self visiting the annotated online documentation (http://dev.mysql.com/doc/) from time to time as you read this book. Another great aspect of MySQL is that it runs on all of today’s popular platforms: Mac OS X, Windows, GNU/Linux, Solaris, FreeBSD, you name it! However, we are biased toward GNU/Linux* and other Unix-like operating systems. Windows users are likely to encounter some differences. For example, file paths are completely dif- ferent. We also refer to standard Unix command-line utilities; we assume you know the corresponding commands in Windows.† Perl is the other rough spot when dealing with MySQL on Windows. MySQL comes with several useful utilities that are written in Perl, and certain chapters in this book present example Perl scripts that form the basis of more complex tools you’ll build. Maatkit is also written in Perl. However, Perl isn’t included with Windows. In order to use these scripts, you’ll need to download a Windows version of Perl from ActiveState and install the necessary add-on modules (DBI and DBD::mysql) for MySQL access. * To avoid confusion, we refer to Linux when we are writing about the kernel, and GNU/Linux when we are writing about the whole operating system infrastructure that supports applications. † You can get Windows-compatible versions of Unix utilities at http://unxutils.sourceforge.net or http:// gnuwin32.sourceforge.net.
  • 23. xvi | Preface Conventions Used in This Book The following typographical conventions are used in this book: Italic Used for new terms, URLs, email addresses, usernames, hostnames, filenames, file extensions, pathnames, directories, and Unix commands and utilities. Constant width Indicates elements of code, configuration options, database and table names, variables and their values, functions, modules, the contents of files, or the out- put from commands. Constant width bold Shows commands or other text that should be typed literally by the user. Also used for emphasis in command output. Constant width italic Shows text that should be replaced with user-supplied values. This icon signifies a tip, suggestion, or general note. This icon indicates a warning or caution. Using Code Examples This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You don’t need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book doesn’t require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code doesn’t require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. Examples are maintained on the site http://www.highperfmysql.com and will be updated there from time to time. We cannot commit, however, to updating and test- ing the code for every minor release of MySQL. We appreciate, but don’t require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “High Performance MySQL: Optimi- zation, Backups, Replication, and More, Second Edition, by Baron Schwartz et al. Copyright 2008 O’Reilly Media, Inc., 9780596101718.”
  • 24. Preface | xvii If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at [email protected]. Safari® Books Online When you see a Safari® Books Online icon on the cover of your favorite technology book, that means the book is available online through the O’Reilly Network Safari Bookshelf. Safari offers a solution that’s better than e-books. It’s a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current informa- tion. Try it for free at http://safari.oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page for this book, where we list errata, examples, and any addi- tional information. You can access this page at: http://www.oreilly.com/catalog/9780596101718/ To comment or ask technical questions about this book, send email to: [email protected] For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our web site at: http://www.oreilly.com You can also get in touch with the authors directly. Baron’s weblog is at http://www. xaprb.com. Peter and Vadim maintain two weblogs, the well-established and popular http://www. mysqlperformanceblog.com and the more recent http://www.webscalingblog.com. You can find the web site for their company, Percona, at http://www.percona.com. Arjen’s company, OpenQuery, has a web site at http://openquery.com.au. Arjen also maintains a weblog at http://arjen-lentz.livejournal.com and a personal site at http:// lentz.com.au.
  • 25. xviii | Preface Acknowledgments for the Second Edition Sphinx developer Andrew Aksyonoff wrote Appendix C, Using Sphinx with MySQL We’d like to thank him first for his in-depth discussion. We have received invaluable help from many people while writing this book. It’s impossible to list everyone who gave us help—we really owe thanks to the entire MySQL community and everyone at MySQL AB. However, here’s a list of people who contributed directly, with apologies if we’ve missed anyone: Tobias Asplund, Igor Babaev, Pascal Borghino, Roland Bouman, Ronald Bradford, Mark Callaghan, Jeremy Cole, Britt Crawford and the HiveDB Project, Vasil Dimov, Harrison Fisk, Florian Haas, Dmitri Joukovski and Zmanda (thanks for the diagram explaining LVM snapshots), Alan Kasindorf, Sheeri Kritzer Cabral, Marko Makela, Giuseppe Maxia, Paul McCullagh, B. Keith Murphy, Dhiren Patel, Sergey Petrunia, Alexander Rubin, Paul Tuckfield, Heikki Tuuri, and Michael “Monty” Widenius. A special thanks to Andy Oram and Isabel Kunkle, our editor and assistant editor at O’Reilly, and to Rachel Wheeler, the copyeditor. Thanks also to the rest of the O’Reilly staff. From Baron I would like to thank my wife Lynn Rainville and our dog Carbon. If you’ve written a book, I’m sure you know how grateful I am to them. I also owe a huge debt of grati- tude to Alan Rimm-Kaufman and my colleagues at the Rimm-Kaufman Group for their support and encouragement during this project. Thanks to Peter, Vadim, and Arjen for giving me the opportunity to make this dream come true. And thanks to Jeremy and Derek for breaking the trail for us. From Peter I’ve been doing MySQL performance and scaling presentations, training, and con- sulting for years, and I’ve always wanted to reach a wider audience, so I was very excited when Andy Oram approached me to work on this book. I have not written a book before, so I wasn’t prepared for how much time and effort it required. We first started talking about updating the first edition to cover recent versions of MySQL, but we wanted to add so much material that we ended up rewriting most of the book. This book is truly a team effort. Because I was very busy bootstrapping Percona, Vadim’s and my consulting company, and because English is not my first language, we all had different roles. I provided the outline and technical content, then I reviewed the material, revising and extending it as we wrote. When Arjen (the former head of the MySQL documentation team) joined the project, we began to fill out the
  • 26. Other documents randomly have different content
  • 30. The Project Gutenberg eBook of The Adventures of an Ugly Girl
  • 31. This ebook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this ebook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook. Title: The Adventures of an Ugly Girl Author: Mrs. George Corbett Release date: October 11, 2018 [eBook #58082] Language: English Credits: Produced by Mary Glenn Krause, amsibert, Barry Abrahamsen, and the Online Distributed Proofreading Team at http://www.pgdp.net (This file was produced from images generously made available by The Internet Archive/American Libraries.) *** START OF THE PROJECT GUTENBERG EBOOK THE ADVENTURES OF AN UGLY GIRL ***
  • 33. Vol. XI., No. 10. November 18, 1893. Subscription Price, $1.50
  • 34. THE ADVENTURES OF AN UGLY GIRL BY MRS. GEORGE CORBETT Author of “When the Sea gives up its Dead,” “Adventures of a Stowaway,” “A Sailor’s Life,” “The Child of the Wreck,” “The Mystery of Fellsmere,” “Tom Penn’s Derelict,” “Adventures of an Amateur Detective,” “Secrets of a Private Enquiry Office,” “The Missing Note,” “New Amazonia,” “Adventures of a Lady Detective,” etc., etc. Issued Semi-Monthly. Entered at the Post-Office at New York as second-class matter. PETER FENELON COLLIER, Publisher, 523 W. 13th St., N.Y.
  • 35. “WORTH A GUINEA A BOX” BEECHAM’S PILLS CURE SICK HEADACHE, DISORDERED LIVER, ETC. They Act Like Magic on the Vital Organs, Regulating the Secretions, restoring long lost Complexion, bringing back the Keen Edge of Appetite, and arousing with the ROSEBUD OF HEALTH the whole physical energy of the human frame. These Facts are admitted by thousands, in all classes of Society. Largest Sale in the World. Covered with a Tasteless & Soluble Coating. Of all druggists. Price 25 cents a box. New York Depot, 365 Canal St.
  • 36. THE ADVENTURES OF AN UGLY GIRL BY MRS. GEORGE CORBETT Author of “When the Sea gives up its Dead,” “Adventures of a Stowaway” “A Sailor’s Life,” “The Child of the Wreck,” “The Mystery of Fellsmere,” “Tom Penn’s Derelict,” “Adventures of an Amateur Detective,” “Secrets of a Private Enquiry Office,” “The Missing Note,” “New Amazonia,” “Adventures of a Lady Detective,” etc., etc. Specially written for “Once a Week Library” Entered according to Act of Congress, in the year 1898 by Peter Fenelon Collier, In the Office of the Librarian of Congress at Washington.
  • 37. All’s Well that ends well; all who have Coughs, Colds and Throat Troubles are made well by Scott’s Emulsion of Cod-liver Oil, with hypophosphites of lime and Soda. When lungs are affected Scott’s Emulsion, if taken in time, prevents consumption. Physicians, the world over, endorse it. The consumption germ takes root and grows when the body is weak and emaciated. The germ passes off when the body is strong. Prepared by SCOTT & BOWNE, N. Y. Druggists sell it.
  • 38. THE ADVENTURES OF AN UGLY GIRL.
  • 39. CHAPTER I. “As ithers see us.”—Burns. “Come, Dora! I shall never be ready, if you don’t make haste. They will be here in ten minutes, and my hair is not half so nice as it ought to be, thanks to your carelessness.” “You are very good to ignore my own claims to attention so utterly. I have been helping you this half-hour and have barely time enough left to change my frock. To make my own hair presentable is impossible now.” “Why, what does it matter how your hair is dressed, or what sort of a gown you put on? You may just as well spare your pains, for unfortunately nothing that you can do seems to mitigate your ugliness. I’m sure I cannot think where you get it. You are—” But, somehow, I did not feel inclined to wait for the end of Belle’s encouraging lecture. Perhaps it was because I was so often treated to my beautiful elder sister’s homilies that they had lost the spark of novelty and had acquired a chestnuty flavor. Perhaps I failed to recognize any generosity in her persistent efforts to nip such latent buds of vanity as from time to time tried to thrust their poor little heads above the chill crust of ridicule and contumely. Perhaps I was really as bad-tempered as I was said to be. Anyhow, my behavior could not claim to be either quiet or elegant as I stormily quitted Belle’s room, slamming the door behind me with such violence as to elicit from my more well-bred sister a little shriek of affected dismay. So far from feeling sorry that I had given Belle’s nerves a shock, I wished viciously that her fingers had been jammed in the doorway, or that something equally disastrous had occurred to take off the
  • 40. edge of her conceit and self-satisfaction. In the corridor I met my brother Jerry, of whom I was devotedly fond. But, although he had evidently some interesting remark to make, I did not stop to speak to him, but hurried noisily to my own room, where I locked myself in, and threw myself on the bed, to give way to a storm of sobs and tears. “And all for what?” it may be asked. “Surely a spiteful remark from one sister to another is hardly worth all this display of feeling.” Ah, well, perhaps one such remark now and then might be treated with the cool contempt which spiteful utterances deserve. But does the reader know what it is to be perpetually and persistently snubbed from one year’s end to the other? Does he realize how hard it must be for a sensitive and love-craving girl to be reminded that she is ugly and unattractive? Not reminded once in a way either, but pretty nearly every day of her life. Or does any one doubt how the heart must needs ache to see all the love and flattery of friends and relations alike showered upon a being whom you know to be empty- headed and frivolous, while everybody seems to regard your plain exterior as sufficient reason why you should be snubbed and neglected? If the reader has ever had any of these experiences, he will the more readily understand my inability to restrain my tears on the especial occasion just mentioned. For it really was a very especial occasion, and I had been more anxious to look well at this particular moment than I ever remembered to have been in my life. I had hoped that Belle, just for once in a way, would take a little interest in my personal appearance, and that she would help me to create as good an impression as possible upon the newcomer whose advent I had both dreaded and longed for. But Belle was too self-engrossed, and too firmly convinced of my hopeless unpresentability, to give the slightest thought either to me or to my feelings. Nay, she had even claimed so much of my time in the task of enhancing her own beauty, that, as we have seen, I had
  • 41. only a few minutes left for myself, and even this morsel of time was not utilized by me, as things turned out. The fact is, I was anxious and overwrought, and Belle’s unkind speeches had multiplied all day until they had utterly broken my composure. “Can it really be true,” I wondered in abject misery, “that nothing I can either do or wear will help to mitigate the first feeling of repulsion which my new mother must necessarily experience at the sight of my ugliness?” The question was of very vital import to me, for I longed for the advent of at least one sympathetic woman in the house; and when I heard that my father, now three years a widower, was about to marry again, I hoped, with a fervor that was nearly akin to agony, that his second wife would be the friend I so sorely needed. True, she would be my stepmother, and she would naturally assume the direction of the household affairs, at once placing the daughters of the house in a subordinate position. This being the case, I believe it would have been more orthodox to have railed against the new invasion, and to have followed the prevailing social custom of resolving to make life miserable for the woman who had presumed to step into my mother’s place. But I always was terribly unorthodox in many things, and, considerably to my father’s surprise, I expressed my enthusiastic delight at the prospect of having a stepmother to reign over me. He need not have been surprised, if he had ever taken the trouble to understand me. But he was wrapped up in Belle’s charms, and never looked at me without regretting either my ugliness or my temper, which all in the house, except dear little Jerry, pronounced unbearable. And yet I can truthfully say, that if I had experienced anything approaching to just treatment, I should have been infinitely sweeter-tempered than my much-bepraised sister, than whom none could have been more unfeeling to the motherless girl whose heart ached for a little love. I generally did Belle’s bidding, for she always contrived to make things unpleasant for me if I rebelled against her authority. But to Lady Elizabeth Courtney I felt ready to yield the
  • 42. most devoted service and obedience, if only she would love me just a little in return; and I had anxiously revolved every means of creating a favorable impression upon her. I meant to have taken considerable pains with my toilet, and to have welcomed the home- coming bride with radiant smiles. And this was how my good resolves had ended. Just when—after working hard all day to see that everything was conducive to a warm and comfortable home-coming—I had begun to hurry through my toilet, I was summoned to Belle’s aid, with the result that instead of giving my stepmother a smiling welcome I was up in my own room, with a face red and swollen with weeping, and a heart full of angry feeling, when she arrived. Presently I heard a carriage approaching, and at the same instant Jerry knocked vigorously at my bedroom door. “Be quick and come down, Dorrie,” he cried, in an eager, excited voice. “Papa and Lady Elizabeth are nearly here, and I want you to run down the avenue with me to meet them.” “I’m not coming,” I answered, with a sob that was audible to Jerry and provoked him to quick wrath. “I knew she would!” he exclaimed. “That horrid Belle’s been at her tricks again and said something nasty. But don’t let her have the best of you like that. Don’t you know that you promised to go with me to meet them, and if you don’t come they won’t believe you are glad about it.” “I can’t help it, Jerry,” was my mournful reply. “I look so hideous just now that I could not possibly face a stranger. Run off quickly yourself. Say that I have a headache or something of the sort, and that I shall try to sleep it off. Run now, there’s a dear boy.” And forthwith Jerry, whose real name, by-the-by, is Gerald Mortimer Courtney, ran along the corridor, down the wide, shallow stairs, across the tiled hall, and into the open air, just as the carriage containing the newly married pair drove into the large graveled space in which the chestnut avenue terminated. In spite of my
  • 43. discomfiture and unpresentable appearance, I possessed my due share of curiosity, and hastily jumped to my feet, crossed the room, and looked through the window at the prancing horses and elegant equipage which bore the newcomers. As soon as the carriage stopped, a liveried footman descended and opened the door with a flourish. By the time he had let the steps down, Belle and Jerry were at the carriage door, and I saw Mr. and Lady Elizabeth Courtney get out and exchange smiles and kisses with my sister and brother, while I, poor pariah, looked on with hungry eyes and an aching heart, and bewailed my luck in seeming ill-natured and inhospitable, after all my efforts to prove the contrary. Lady Elizabeth, I must explain, had had some love passages with my father a long time ago. But their youthful desires had been taught to bow to the demands of fortune and position. Lady Elizabeth was the daughter of an earl, and could aspire to more material comforts than could have been provided for her by the penniless younger son of a country squire. True, the earl had no money, and what little land was still left him was mortgaged up to the hilt. But he had many friends who possessed sufficient influence to pitchfork his four sons into government sinecures. He had a cousin also, the Duchess of Lyndene, who chaperoned his handsome, clever daughter through two whole seasons, and eventually resigned her charge into the care of Samuel Chisholm, Esquire, once upon a time a shoeblack, now the proud possessor of twenty thousand a year, all made by the judicious advertisement of his prize patent blacking. Upon the whole, the earl’s daughter was supposed to have done tolerably well for herself, and as her husband’s fortune steadily increased there was every reason for her to feel satisfied. Even the incumbrance which she had been compelled to take with the fortune was not especially disagreeable to her, for Mr. Chisholm was a very clever man, whose mental and social equipments kept pace with his fortunes, and, in spite of his low origin and antecedents, he was as courtly and well-bred as Lady Elizabeth’s nobly-born brothers. The pair therefore lived harmoniously enough together, at least to
  • 44. outward seeming, for many years. Then Mr. Chisholm died somewhat suddenly, and his will was read in due course. It was during that important ceremony that the unexpectedly bereaved widow first felt real resentment against her late husband. For though he had died a millionaire, he had only willed his wife a life interest of five thousand a year, which was quite a paltry income compared with the princely revenue she had expected to be hers. To her father a like fortune was bequeathed, in addition to a sum of thirty thousand pounds wherewith to redeem his impoverished estate. The widow’s brothers each received a gift of five thousand pounds, and to the widow herself was willed all the personal property of the deceased. All the rest of his vast fortune was divided among a swarm of poor relations, whose existence Lady Elizabeth had never acknowledged, but who no doubt showered blessings on the memory of the dead man who had thus befriended his own flesh and blood. The Earl of Greatlands, too, declared himself delighted with his son-in-law’s generosity. But his daughter did not hesitate to say that she had been treated shamefully, and at once proclaimed her intention of resigning the tenancy of the costly London establishment, which it would be a farce to attempt to keep up on five thousand a year. She retired to a pretty place in the country, declining to reside with her father, who, elated by his unwonted prosperity, was actually talking of taking a young wife to comfort his old age. My father had, meanwhile, married my mother, whose memory I adore, for she loved me passionately, and while she lived I was never humiliated, as was perpetually the case after her death, which occurred some three years before my story opens. I do not remember hearing how my father came across Lady Elizabeth again, but I believe that their early attachment soon reasserted itself, and though he was much the poorer of the two, and encumbered with three children, the match was soon arranged. Although Lady Elizabeth had been dissatisfied with her widow’s portion she was very much richer than we were, and her coming to
  • 45. Courtney Grange was likely to be a very important event to the previous humble inhabitants thereof. In addition to the Grange, which had been my maternal grandfather’s property, my father had just six hundred a year, derived partly from what his father had left him, partly from my mother’s small fortune. Our establishment consisted of two servants, in addition to the family. Their names were John and Martha Page. They had never seen any other service but that of my father and grandfather, and had lived seventeen years under the same roof before it entered their heads to amalgamate their interests by marrying. They were quite used to the constant scraping and economizing which we were compelled to practice, and did not look upon the arrival of a new mistress as an unmixed blessing, even though she was bringing a good income with her. As for Belle, she was quite wild with delight at the gorgeous prospect which opened itself before her mental vision. London seasons, presentations at court, halcyon days of brilliant pleasure, and a swarm of dukes and earls sighing for the honor of her hand. These were some of the glowing visions in which she indulged. “And I mean to get into Lady Elizabeth’s good graces, whether I like her or not,” she informed me. “She can do so much for me if she likes, and I can be amiability itself when I like. Besides, my looks will win her over at once. She will soon see what credit I can do to pretty gowns. As for you, you’ll be lucky if she tolerates you at all. I’m sure it’s a shame that our family’s reputation for beauty should suffer as it does through you.” And so on, ad libitum. Of course, I was not surprised to see her warm, gushing welcome of my father and his wife, nor to note the glance of surprised admiration which the latter cast upon Belle and Gerald, for they were really both very beautiful, and both tall and well-grown, with lovely golden hair, rich deep blue eyes, and an exquisite complexion, united to perfect features. Lady Elizabeth, too, I was sorry to see, was a tall, handsome woman, who by no means looked her forty years. When I say that I was sorry to observe this, it must not be imagined that I grudged
  • 46. her her good looks. But I had had a vague notion that if she were comparatively plain she would the more easily sympathize with my troubles, into which no one in the house except Jerry seemed able to enter. Now my hopes in that direction were upset, and I already knew instinctively that my own absence was being commented upon. I saw my father, the very picture of masculine comeliness, glance up at my window with an angry frown, and I knew almost as well as if I had been present what Belle and Jerry were saying about me. After all, I thought, I had been very foolish to let Belle’s ill-nature and my own ill-temper spoil my resolve to make Lady Elizabeth’s home-coming as pleasant as possible. Apart from looks, my remaining upstairs would have already made me lose ground with my stepmother. Was it too late, I wondered, to rectify my error, and make my appearance before dinner was served? Answering the question in the negative, I resolved to complete my toilet as quickly as possible, and get over the ordeal of the first meeting without further loss of time. So I began operations at once, wondering, while I brushed my hair, how it was that I was so different to Jerry and Belle. I pulled faces at my own ugly reflection in the glass, but as that only seemed to make matters worse, I desisted. But I could not banish the discontent which enhanced my ugliness, and made it almost perfect in its own way. Why was I so short and dumpy? I asked myself vainly. And why was my hair so black, and lank, and scanty? And how was it that my complexion was more like Thames mud than anything else? And why was my face covered with freckles? These freckles I always felt to be an especial aggravation of nature; for whoever heard of freckles on a dark, sallow skin? And then, how did it happen that my eyes were of a pale watery-brown hue, while I had hardly got either eyelashes or eyebrows that were visible? And why, oh, why! had my nose got that exasperating habit of looking skyward?
  • 47. Even as I asked these questions of myself, I felt how hopeless it was to attempt to answer them. So I abandoned them and tried to console myself with the reflection that my mouth was well-shaped and that I had splendid teeth. But then my great red hands obtruded themselves upon my notice, and blotted out all consciousness of my redeeming features. I took considerable pains with my hair, and put on my best dress. Alas! the latter was of a curious brown shade which somehow only seemed to enhance my ugliness. Belle was dressed in a dainty pink cambric; but I was never allowed such a luxury, as it was considered that I was too untidy, and too plain, and altogether too unsuitable to indulge in pretty things. Besides, we had to be economical, and as I could never hope to captivate a lover, no matter how I was dressed, it would have been a shame to waste money upon my futile adornment. So Belle argued, and I had hitherto had no choice but to bow to her arguments. I was at last ready to go downstairs, when once more Jerry came to look me up. “Oh, you’re donned up, are you?” he remarked. “And, upon my word, you’re looking quite spry.” But I was not to be soothed by such negative flattery as this, and sternly asked Jerry what he meant by “looking quite spry.” “Why, spry, you know, spry means—at least, I mean—that you look as if you were going to a prayer meeting; that is, you look so prim, and tidy, and straight. But, Dorrie, dear, I like you far better as you were this morning, and as you generally are. You look real jolly then.” Saying this, Jerry kissed me warmly, and I forthwith resigned myself to the hopelessness of attempting to improve my appearance. This morning I had worn an old lilac print that had originally been made for Belle. It was faded with much washing, and possessed sundry little adornments in the way of frayed edges and sleeves out at elbows. Truly, Belle had been right, after all, and it was sheer folly on my part to rebel against fate, since neither
  • 48. coaxing nor rebelling seemed to propitiate her. Seeing, therefore, how stern and uncompromising she was with me, I resolved to take less notice of her in future, and had no sooner made the resolve than I began to feel peaceful and self-possessed. What if the gift of beauty was denied me, had I not many other blessings to be thankful for? In all my seventeen years of life I had never had anything but the most robust health, and if my school record was anything to go by, I possessed a much more valuable property in the way of brains than Belle did. These should outweigh my physical defects, and prove my passport to the world’s good graces. I dare say Jerry was rather surprised to see me suddenly straighten myself up, and assume a much more cheerful expression. “What is Lady Elizabeth like?” I asked. “Looks?” “No, ways.” “Well, I take her to be rather a brick, do you know. She was as pleasant and as much at home with Belle and me as if she had lived here all her life and had just been off for a holiday. She thinks we are just like pa, and that is high praise, I should fancy.” “Very high praise, Jerry. I wonder what she’ll say about me. But it doesn’t matter. Is dinner nearly served?” “Yes; but John was grumbling because you hadn’t helped to see that the table was all right, as you had promised to do.” “Oh! Poor John. It was a shame of me to forget all about him. I’ll hurry down now and see what I can do. Come on, Jerry.” A minute later we were both skipping nimbly downstairs, and while Jerry, at my earnest request, ran round to the stable to see how my bull-terrier, Bobby, was progressing, I ran into the kitchen to make my peace with John and Martha. As Martha was somewhat sulky, and protested that they had managed very well without me, I made my way to the dining-room, and began swiftly to re-arrange the flowers which I had culled for the table earlier in the day. John
  • 49. looked rather scandalized, and remarked that he thought he knew how to arrange a table as well as most folks. But I did not heed John’s grumbling much, for it was his chronic condition, and I had just completed my little task to my own satisfaction when John rang the second dinner-bell, the first not having been noticed by me. Just then Jerry came back. “Bobby will be all right in a day,” he said, whereat I expressed my satisfaction, for I had been greatly troubled when poor Bobby had come limping home with every sign of war about him. “And, oh!” I said, with sudden remembrance, “what has been done with the wonderful carriage and pair, and those gorgeous servants?” “They went straight home. They belong to the earl. He sent them to meet Lady Elizabeth at the station. Her own carriages are coming after she has seen what arrangements it will be best to make here. I fancy she doesn’t like the place very much.” “Not like the Grange?” I exclaimed indignantly. “Why, she must be a veritable heathen—” “Dora, I regret that you should think fit to behave so badly, but must demand a little of your attention, while I introduce you to the notice of Lady Elizabeth Courtney.” Was ever luck like mine? Here had I quite lost sight of the fact that my father and his wife might enter the room at any time, and they had actually overheard me speak in tones of contempt of the one woman on earth whom I wished to propitiate! I turned hurriedly round, and saw my father, looking very irate, Lady Elizabeth, looking coldly critical, and Belle, looking ill-naturedly triumphant. “I beg your pardon, papa. I did not mean it,” I stammered. “No, I do not suppose you did mean us to overhear you,” he replied sternly. “But I have no doubt that you had resolved to be intensely disagreeable, and I tell you plainly that I will not have it. You see, my love,” he said, turning to his wife, “you will have a little
  • 50. temper and self-will to deal with, but I am sure you will know how to compel it to keep within due bounds.” What could I do or say after that? Nothing, of course, and I sat miserably through the whole meal, while all but Jerry laughed and talked as if quite unconscious of my presence. I would fain have escaped to my own room when the dinner was over. But my father had taken it into his head that I merely wanted to be obstinate and disagreeable, and suggested that I should spend an hour in the drawing-room. I accordingly took refuge at the piano. But my music was so melancholy that I am not surprised that I was asked to desist, for, when you come to think of it, “Killigrew’s Lament,” and “The Dead March in Saul,” haven’t a very bridal sound about them. So far Lady Elizabeth had not spoken directly to me, and whenever my eyes wandered in her direction, I could see that her glance was very critical, but I could not be sure that it was quite so disapproving as I had expected. Yet, although I neither spoke, nor was spoken to, there was no constraint between the others, for my father and Lady Courtney were both good conversationalists, and Belle could chatter by the hour, provided the talk was kept at a suitably frivolous level. Jerry, after being petted and praised a little, had been sent to bed primed with a quartet of kisses, and jubilant in the possession of a bright sovereign which papa had given to him in honor of the advent of a new mistress at Courtney Grange. “Belle, dear, suppose you play us one of your pretty pieces,” said my father. Whereupon I vacated the music-stool, and took refuge near the big oriel window which overlooked the orchard, and which was my especial delight. For it was like a small room in itself, and I did not feel quite so lost among its cozy, faded draperies as I did in any other part of our drawing-room, which always seemed to me to be much too large for the furniture that was in it. Belle, after a great deal of fidgeting and looking round at herself, to make sure that her dress was falling in graceful folds, struck a few chords on what had been a very fine piano in its day, but which even I, who was partial
  • 51. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookultra.com