Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.
com
Expert Performance Indexing in SQL Server 2019:
Toward Faster Results and Lower Maintenance 3rd
Edition Jason Strate
https://textbookfull.com/product/expert-performance-
indexing-in-sql-server-2019-toward-faster-results-and-lower-
maintenance-3rd-edition-jason-strate/
OR CLICK BUTTON
DOWNLOAD NOW
Explore and download more ebook at https://textbookfull.com
Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.
High Performance SQL Server: The Go Faster Book 1st
Edition Benjamin Nevarez (Auth.)
https://textbookfull.com/product/high-performance-sql-server-the-go-
faster-book-1st-edition-benjamin-nevarez-auth/
textboxfull.com
Expert T-SQL Window Functions in SQL Server 2019: The
Hidden Secret to Fast Analytic and Reporting Queries Kathi
Kellenberger
https://textbookfull.com/product/expert-t-sql-window-functions-in-sql-
server-2019-the-hidden-secret-to-fast-analytic-and-reporting-queries-
kathi-kellenberger/
textboxfull.com
Expert SQL Server Transactions and Locking: Concurrency
Internals for SQL Server Practitioners 1st Edition Dmitri
Korotkevitch
https://textbookfull.com/product/expert-sql-server-transactions-and-
locking-concurrency-internals-for-sql-server-practitioners-1st-
edition-dmitri-korotkevitch/
textboxfull.com
Expert SQL Server In-Memory OLTP 2nd Edition Dmitri
Korotkevitch
https://textbookfull.com/product/expert-sql-server-in-memory-oltp-2nd-
edition-dmitri-korotkevitch/
textboxfull.com
Practical Maintenance Plans in SQL Server Automation for
the DBA Beard
https://textbookfull.com/product/practical-maintenance-plans-in-sql-
server-automation-for-the-dba-beard/
textboxfull.com
Expert Scripting and Automation for SQL Server DBAs
Springerlink (Online Service)
https://textbookfull.com/product/expert-scripting-and-automation-for-
sql-server-dbas-springerlink-online-service/
textboxfull.com
SQL Server Execution Plans For SQL Server 2008 through to
2017 and Azure SQL Database 3rd Edition Grant Fritchey
https://textbookfull.com/product/sql-server-execution-plans-for-sql-
server-2008-through-to-2017-and-azure-sql-database-3rd-edition-grant-
fritchey/
textboxfull.com
Practical Maintenance Plans in SQL Server Automation for
the DBA 1st Edition Bradley Beard
https://textbookfull.com/product/practical-maintenance-plans-in-sql-
server-automation-for-the-dba-1st-edition-bradley-beard/
textboxfull.com
Expert Scripting and Automation for SQL Server DBAs 1st
Edition Peter A. Carter (Auth.)
https://textbookfull.com/product/expert-scripting-and-automation-for-
sql-server-dbas-1st-edition-peter-a-carter-auth/
textboxfull.com
Jason Strate
Expert Performance Indexing in SQL
Server 2019
Toward Faster Results and Lower Maintenance
3rd ed.
Jason Strate
Hugo, MN, USA
Any source code or other supplementary material referenced by the
author in this book is available to readers on GitHub via the book’s
product page, located at www.apress.com/9781484254639 . For more
detailed information, please visit http://www.apress.com/source-code
.
ISBN 978-1-4842-5463-9 e-ISBN 978-1-4842-5464-6
https://doi.org/10.1007/978-1-4842-5464-6
© Jason Strate 2019
This work is subject to copyright. All rights are reserved by the
Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather
than use a trademark symbol with every occurrence of a trademarked
name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark. The use in this publication
of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of
opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true
and accurate at the date of publication, neither the authors nor the
editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained
herein.
Distributed to the book trade worldwide by Springer Science+Business
Media New York, 233 Spring Street, 6th Floor, New York, NY 10013.
Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-
[email protected], or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
Thanks to my family and friends for their support while I had to duck out
early at times to try to avoid missing deadlines on this edition.
—Jason Strate
Introduction
Today’s world is all about the data. From the applications to manage
our lives to the analytics we use to guide our decisions, data is
everywhere. Behind data, databases provide the engine to get to our
data, but without the right indexes we lack the fuel to access our data
efficiently.
When it comes to indexes, no single structure aids in retrieving data
from a database more than an index. New features in SQL Server
provide new and unique ways to leverage and access your data, but
without going back to the basics and ensuring that the data is properly
indexed, you’ll find that even the new features fail to live up to
expectations.
Indexes represent both how data is stored and the access paths by
which data can be retrieved from your database. Without indexes, a
database is an unordered mess minus the roadmap to find the
information you want.
Throughout my experience working on data platforms, one of the
most common resolutions that I provide for performance tuning and
application outages is to provide the right indexes for the underlying
databases. Often, the effort of adding an index or two to the most
accessed tables within a database provides significant performance
improvements—much more so than tuning the database at a per SQL
statement level. This is because an index affects many SQL statements
that are being run against the database lifting performance across the
workload.
Managing indexes may seem like an easy task. Unfortunately, their
seeming simplicity is often the key to why they are overlooked. Often,
there is an assumption from developers that the database
administrators will take care of indexing. Or there is an assumption by
the database administrators that the developers are building the
necessary indexes as they develop features in their applications. While
these are primarily cases of miscommunication, people need to know
how to determine what indexes are necessary and the value of those
indexes. This book provides that information.
Outside of the aforementioned scenarios is the fact that applications
and the data they use change over time. Features created and used to
tune the database may not be as useful as expected, or a small feature
change may lead to a big change in how the application and underlying
databases are used. All of this change affects the database and what
needs to be accessed. As time goes on, databases and their indexes need
to be reviewed to determine if the current indexing is accurate for the
new load. This book also provides information in this regard.
What’s in This Book?
From beginning to end, this book provides information that helps build
your skills from a novice at indexing to an expert. The chapters are laid
out such that you can start at any place to fill in the gaps in your
knowledge and build out from there. Whether you can barely spell
index, need to understand the fundamentals, or need to build an
indexing methodology, the information is available here.
Chapter 1 covers index fundamentals. It lays the groundwork for all
of the following chapters. This chapter provides information regarding
the types of indexes available in SQL Server. It covers some of the
Primary index types and defines what these are and how to build them.
The chapter also explores the options available that can change the
structure of indexes. From fill factor to included columns, the available
attributes are defined and explained.
Chapter 2 picks up where the previous chapter left off. Going
beyond defining the indexes available, the chapter looks at the physical
and logical structure of indexes and the components that make up
indexes. This internal understanding of indexes provides the basis for
grasping why indexes behave in certain ways in certain situations. As
you examine the structures of indexes, you’ll become familiar with the
tools you can use to begin digging into these structures on your own.
Armed with an understanding of the indexes available and how they
are built, Chapter 3 explores the statistics that are stored on the indexes
and how to use this information; these statistics provide insight into
how SQL Server is utilizing indexes. The chapter also provides
information necessary to decipher why an index may not be selected
and why it is behaving in a certain way. You will gain a deeper
understanding of how this information is collected by SQL Server
through dynamic management views and what data is worthwhile to
review.
Not every index type is fully discussed in the first chapter; the types
not discussed are covered in Chapters 4 , 5 , and 6. Beyond the rowstore
and columnstore index structures, there are a few other index types
which are Extensible Markup Language (XML), spatial, full-text, and
semantic search. These indexes are applicable to specific situations. In
these chapters, you’ll look into these other index types to understand
what they have to offer. You’ll also look at situations where they should
be implemented.
In a similar fashion to the previous three chapters, Chapter 7 takes a
dive into memory-optimized tables. Memory-optimized tables were
new to SQL Server 2014 and provided a unique capability to provide
improved performance with tables that reside in memory when online.
This chapter will look at how indexes function on these types of tables
and what restrictions still remain.
Chapter 8 identifies and debunks some commonly held myths about
indexes. Also, it outlines some best practices in regard to indexing a
table. As you move into using tools and strategies to build indexes in the
chapters that follow, this information will be important to remember.
With a firm grasp of the options for indexing, the next thing that
needs to be addressed is maintenance. In Chapter 9 , you’ll look at what
needs to be considered when maintaining indexes in your environment.
We’ll look at both the fragmentation of the indexes and the underlying
statistics that supports how SQL Server determines how the index can
be used.
SQL Server is not without tools to automate your ability to build
indexes. Chapter 10 explores these tools and looks at ways that you can
begin building indexes in your environment today with minimal effort.
The four tools discussed are the missing index dynamic management
views (DMVs), Database Engine Tuning Advisor (DTA), Query Store, and
Automatic Database Tuning. You’ll look at the benefits and issues
regarding these tools and get some guidance on how to use them
effectively in your environment.
The tools alone won’t give you everything you need to index your
databases. In Chapter 11 , you’ll begin to look at how to determine the
indexes that are needed for a database and a table. There are a number
of strategies for selecting what indexes to build within a database. They
can be built according to recommendations by the query optimizer.
They also should be built to support metadata structures such as
foreign keys. For each strategy of indexing, there are a number of
considerations to take into account when deciding whether or not to
build the index.
Part of effective indexing is writing queries that can utilize an index
on a query. Chapter 12 discusses a number of strategies for indexing.
Sometimes when querying data, the indexes that you assume will be
used are not used after all. These situations are usually tied into how a
query is structured or the data that is being retrieved. Indexes can be
skipped due to SARGability issues (where the query isn’t being properly
selective on the index). They can also be skipped over due to tipping
point issues, such as when the number of reads to retrieve data from an
index potentially exceeds the reads to scan that or another index. These
issues affect index selection as well as the effectiveness and justification
for some indexes.
Today’s DBA isn’t in a position where they have only a single table to
index. A database can have tens, hundreds, or thousands of tables, and
all of them need to have the proper indexes. Beginning in Chapter 13 ,
you’ll learn some methods to approach indexing for a single database
but also for all of the databases on a server and servers within your
environment.
What’s New in This Edition?
With three new versions of SQL Server released since the last edition of
this book, there have been a significant number of changes to how
indexes can be applied to your databases and data. Some of the key
changes to SQL Server that involve indexing are as follows:
Changes in indexing restrictions to memory-optimized tables and
columnstore indexes
Improvements to maintenance processes for indexes including
improved processing and ability to pause and restart index rebuilds
New tools to review query execution to identify and automate index
selection
Improvements to partitioning and statistics
Changes in dynamic management objects (DMOs) available that
improve capabilities to inspect indexes and data pages
All of these changes and more are spread throughout the book in all
of the chapters. Even though there have been a number of releases of
SQL Server since the last edition, the primary focus will be on SQL
Server 2019 as the current state of SQL Server. Where applicable,
information will be included to indicate features made available since
the last edition, namely, calling out changes from SQL Server 2016 and
2017.
Summary
As previously mentioned, data is important, and indexes provide the
way for you to get to that data. Through the chapters in this book, you
will become armed with what you need to know about the indexes in
your environment. You will also learn how to find the information you
need to improve the performance of your environment.
Table of Contents
Chapter 1:Index Fundamentals
Why Build Indexes?
Major Index Types
Heap Tables
Clustered Indexes
Nonclustered Indexes
Columnstore Indexes
Other Index Types
JSON and XML Indexes
Spatial Indexes
Hash and Range Indexes
Full-Text Search
Index Variations
Primary Key
Unique Index
Included Columns
Partitioned Indexes
Filtered Indexes
Compression and Indexing
Index Data Definition Language
Creating an Index
Altering an Index
Dropping an Index
Index Metadata
sys.indexes
sys.index_columns
sys.index_resumable_operations
sys.xml:indexes
sys.selective_xml:index_paths
sys.selective_xml:index_namespaces
sys.spatial_indexes
sys.spatial_index_tessellations
sys.column_store_dictionaries
sys.column_store_segments
sys.column_store_row_groups
sys.hash_indexes
sys.fulltext_catalogs
sys.fulltext_indexes
sys.fulltext_index_columns
Summary
Chapter 2:Index Storage Fundamentals
Storage Basics
Pages
Extents
Page Types
File Header Page
Boot Page
Page Free Space Page
Global Allocation Map Page
Shared Global Allocation Map Page
Differential Changed Map Page
Minimally Logged Page
Index Allocation Map Page
Data Page
Index Page
Large Object Page
Organizing Pages
Heap Structure
B-Tree Structure
Columnstore Structure
Examining Pages
Dynamic Management Functions
DBCC Commands
Page Fragmentation
Forwarded Records
Page Splits
Index Characteristics
Heap
Clustered Index
Nonclustered Index
Columnstore Index
Summary
Chapter 3:Index Metadata and Statistics
Column-Level Statistics
DBCC SHOW_STATISTICS
Catalog Views
STATS_DATE
sys.dm_db_stats_properties
sys.dm_db_stats_histogram
sys.dm_db_incremental_stats_properties
Statistics DDL
Colum-Level Statistics Summary
Index Usage Statistics
Header Columns
User Columns
System Columns
Index Usage Stats Summary
Index Operational Statistics
Header Columns
DML Activity
SELECT Activity
Locking Contention
Latch Contention
Page Allocation Cycle
Compression
LOB Access
Row Version
Index Operational Stats Summary
Index Physical Statistics
Header Columns
Row Statistics
Fragmentation Statistics
Index Physical Stats Summary
Columnstore Statistics
Columnstore Physical Stats
Columnstore Operational Stats
Summary
Chapter 4:XML Indexes
XML Data
Benefits
Cautions
XML Indexes
Primary/Secondary XML Indexes
Selective XML Indexes
Summary
Chapter 5:Spatial Indexing
How Spatial Data Is Indexed
Creating Spatial Indexes
Supporting Methods with Indexes
Understanding Statistics, Properties, and Information
The Views
The Procedures
Tuning Spatial Indexes
Restrictions on Spatial Indexes
Summary
Chapter 6:Indexing Memory-Optimized Tables
Memory-Optimized Tables Overview
Hash Indexes
Range Indexes
Summary
Chapter 7:Full-Text Indexing
Full-Text Indexing
Creating a Full-Text Example
Creating a Full-Text Catalog
Creating a Full-Text Index
Full-Text Search Index Catalog Views and Properties
Summary
Chapter 8:Indexing Myths and Best Practices
Index Myths
Myth 1:Databases Don’t Need Indexes
Myth 2:Primary Keys Are Always Clustered
Myth 3:Online Index Operations Don’t Block
Myth 4:Any Column Can Be Filtered in Multicolumn Indexes
Myth 5:Clustered Indexes Store Records in Physical Order
Myth 6:Indexes Always Output in the Same Order
Myth 7:Fill Factor Is Applied to Indexes During Inserts
Myth 8:Deleting from Heaps Results in Unrecoverable
Space
Myth 9:Every Table Should Have a Heap/Clustered Index
Index Best Practices
Index to Your Current Workload
Use Clustered Indexes on Primary Keys by Default
Specify Fill Factors
Index Foreign Key Columns
Balance Index Count
Summary
Chapter 9:Index Maintenance
Index Fragmentation
Fragmentation Operations
Fragmentation Variants
Fragmentation Issues
Defragmentation Options
Defragmentation Strategies
Preventing Fragmentation
Index Statistics Maintenance
Automatically Maintaining Statistics
Manually Maintaining Statistics
Summary
Chapter 10:Indexing Tools
Missing Indexes
Explaining the DMOs
Using the DMOs
Database Engine Tuning Advisor
Explaining the DTA
Using the DTA GUI
Using the DTA Utility
Summary
Chapter 11:Indexing Strategies
Heaps
Temporary Objects
Other Heap Scenarios
Clustered Indexes
Identity Sequence
Natural Key
Foreign Key
Multiple Column
Globally Unique Identifier
Nonclustered Indexes
Search Columns
Index Intersection
Multiple Column
Covering Index
Included Columns
Filtered Indexes
Foreign Keys
Columnstore Index
JSON Indexing
Index Storage Strategies
Row Compression
Page Compression
Indexed Views
Summary
Chapter 12:Query Strategies
LIKE Comparison
Concatenation
Computed Columns
Scalar Functions
Data Conversion
Summary
Chapter 13:Monitoring Indexes
Performance Counters
Dynamic Management Objects
Index Usage Stats
Index Operational Stats
Index Physical Stats
Wait Statistics
Data Cleanup
Event Tracing
SQL Trace
Extended Events
Query Store
Summary
Chapter 14:Index Analysis
Review of Server State
Performance Counters
Wait Statistics
Buffer Allocation
Schema Discovery
Identify Heaps
Duplicate Indexes
Overlapping Indexes
Unindexed Foreign Keys
Uncompressed Indexes
Database Engine Tuning Advisor
Unused Indexes
Index Plan Usage
Summary
Chapter 15:Indexing Methodology
The Indexing Method
Implement
Communication
Deployment Scripts
Execution
Repeat
Summary
Index
About the Author and About the Technical
Reviewer
About the Author
Jason Strate
is senior database architect and developer working in the financial
services industry. He has been making data cool again for nearly 20
years, which includes more than a decade of consulting with companies
across the United States. A previous recipient of Microsoft Most
Valuable Professional award for Data Platform (formerly SQL Server)
from 2009 to 2016, Jason’s done fun stuff like getting certifications,
blogging, authoring books, and presenting on technologies. These days,
he’s most often splitting his time between reading, karaoke, and the
PASS Cloud Virtual Group.
About the Technical Reviewer
Rodney Landrum
went to school to be a poet and a writer.
And then he graduated, so that dream
was crushed. He followed another path,
which was to become a professional in
the fun-filled world of information
technology. He has worked as a systems
engineer, UNIX and network admin, data
analyst, client services director, and
finally database administrator (DBA).
The old hankering to put words on
paper, while paper still existed, got the
best of him and in 2000 he began writing
technical articles, some creative and
humorous, some quite the opposite. In 2010, he wrote SQL Server
Tacklebox , a title his editor disdained, but a book closest to the true
creative potential he sought; he still yearned to do a full book without a
single screenshot, which he accomplished in 2019 with his first
novel,Chronicles of Shameus . He currently works from his castle office
in Pensacola, FL, as a senior DBA consultant for Ntirety, a division of
Hostway/Hosting.
© Jason Strate 2019
J. Strate, Expert Performance Indexing in SQL Server 2019
https://doi.org/10.1007/978-1-4842-5464-6_1
1. Index Fundamentals
Jason Strate1
(1) Hugo, MN, USA
The goal of this book is to help you improve the performance of your
databases through the use of indexes. In order to accomplish this, you
must first understand what indexes are and why you need them. You
need to understand the differences between how data in a clustered
index, columnstore index, and heap table is stored. You also will look at
how nonclustered and other index types are built and how indexes
interact with other indexes. This chapter will provide the building
blocks for understanding the logical design of indexes.
Why Build Indexes?
The most important asset any business owns is its data. Databases exist
to store that data. A key piece in providing the data is delivering it
efficiently. Being able to efficiently access data improves the value that
the business gains from the data. The way to do that is through indexes.
Indexes are the means to providing an efficient access path between
the user and the data. By providing this access path, the user can ask for
data from the database, and the database will know where to go to
retrieve the data and how to do so with minimal effort.
Why not just have all the data in a table and return it when it is
needed? Why go through the exercise of creating indexes? Returning
data when needed is actually the point of indexes; they provide the path
that is necessary to get to the data in the quickest manner possible.
Without indexes to provide a map to where data is located, database
systems have to search through all of the available data to know that
the required data has been accessed. In today’s world where terabytes
of data is common, it’s important to be able to quickly and efficiently
get to the data needed.
To illustrate, let’s consider an analogy that is often used to describe
indexes—a library. When you go to the library, there are shelves upon
shelves of books. In this library, a common task repeated over and over
is finding a book. Most often you are particular on the book that you
need, and you have a few options for finding that book.
In the library, books are stored on the shelves using the Dewey
Decimal Classification system. This system assigns a number to a book
based on its subject. Once the value is assigned, the book is stored in
numerical order within the library. For instance, books on science are in
the range of 500–599. From there, if you wanted a book on
mathematics, you would look for books with a classification of 510–
519. Then to find a book on geometry, you’d look for books numbered
516. With this classification system, finding a book on any subject is
easy and efficient. Once you know the number of the book you are
looking for, you can go directly to the stack in the library where the
books with 516 are located, instead of wandering through the library
until you happen upon the geometry books. This is exactly how indexes
work; they provide an ordered manner to store information that allows
users to easily find the data.
What happens, though, if you want to find all the books in a library
written by Jason Strate? You could make an educated guess that they
are all categorized under databases, but you would have to know that
for certain. The only way to do that would be to walk through the
library and check every stack. The library has a solution for this
problem—the card catalog.
Most card catalogs are available through computer terminals these
days, but back when I was a kid, they consisted of individual cards that
were ordered by author, title, subject, and category. Using the card
catalog, you would be able to find the Dewey Decimal number for any
book. For instance, searching by author, you could find all books written
by Jason Strate. Thus, instead of wandering through the stacks and
checking each book to see whether I wrote it, you could instead go to
the specific books in the library written by me. In essence, this is also
how indexes work. The index provides a location of data so that queries
can go directly to the data.
Without these mechanisms, finding books in a library, or
information in a database, would be difficult. Instead of going straight
to the information, you’d wander through the library aisle to aisle
trying to find what you need. In smaller libraries, such as Little Free
Libraries, this isn’t much of a problem, since there are so few books. But
as the library gets larger and settles into a building, it just isn’t efficient
to browse all the stacks. And when there is research that needs to be
done and books need to be found, there isn’t time to browse through
everything.
This analogy has hopefully provided you with the basis to
understand the purpose and the need for indexes. In the following
sections, I’ll dissect this analogy a bit more and pair it with the different
indexing options that are available in SQL Server databases.
Major Index Types
You can categorize indexes in different ways. However, it’s essential to
understand the four major categories described in this particular
section: heaps, clustered, columnstore, and nonclustered indexes.
Heaps, clustered indexes, and clustered columnstore indexes directly
affect how data in the underlying tables are stored. Nonclustered
indexes are independent of data storage. The first step toward
understanding indexing is to grasp this categorization scheme.
Heap Tables
As mentioned in the library analogy, in a Little Free Library, the books
available change often; usually there are only one or two short shelves
of books. In these cases, the owner doesn’t spend time organizing the
books under the Dewey Decimal system. Instead, the books are placed
on the shelves as they are acquired. In this case, there is no order to
how the books are stored in the library. When SQL Server stores data in
a table in a similar fashion, when the data lacks an ordered structure, it
is referred to as a heap .
In a heap, the first row added to the index is the first record in the
table, the second row is the second record in the table, the third row is
the third record in the table, and so on. There is nothing in the data that
is used to specify the order in which the data has been added. The data
and records are in the table without any particular order.
When a table is first created, the initial storage structure is called a
heap. This is probably the simplest storage structure. Rows are inserted
into the table in the order in which they are added. A table uses a heap
until a clustered index or clustered columnstore index is created on the
table or the table is created as memory-optimized, discussed in Chapter
7. A table can be a heap only if there are no other index types that
define how the base data is stored on the table. Only a single heap
structure is allowed per table.
Note Most people don’t consider heaps to be indexes. That’s fine.
In the context of this discussion, we will treat them as indexes as
they assist in determining where data will be located and how it will
be accessed by queries.
Clustered Indexes
In the library analogy, you reviewed how the Dewey Decimal system
defines how books are sorted and stored in the library. Regardless of
when the book is added to the library, with the Dewey Decimal system,
it is assigned a number based on its subject and placed on the shelf
between other books of the same subject. The subject of the book, not
when it is added, determines the location of the book. This structure is
the most direct method to find a book within the library. In the context
of a table, the index that provides this functionality in a database is
called a clustered index.
With a clustered index , one or more columns are selected as the key
columns for the index. Key columns are used to sort and determine
where to locate data in the table. Where a library places books on the
shelves based on their Dewey Decimal number, a clustered index
determines the location of records in the table based on the logical
order of the key columns of the index.
The columns used as the key columns for a clustered index are
selected based on the most frequently used method for accessing the
records in the table. For instance, in a table with states and provinces,
the most common method of finding a record in the table would
probably be through its abbreviation. In that situation, using the
abbreviation for the clustering key column would be best. With most
tables, the primary key or business key will serve as the clustered index
key columns.
As with heaps, clustered indexes determine where data is located in
a table. In a clustered index, the data outside the key columns is stored
alongside the key columns. This equates to the clustered index
determining the physical table itself, just as a heap defines the table.
Due to this, a table cannot have more than one clustered index.
Nonclustered Indexes
As was noted in my analogy, the Dewey Decimal system doesn’t account
for every way in which a person may need to search for a book. If the
author or title is known but not the subject, then the classification
doesn’t really provide any value. Libraries solve this problem with card
catalogs, which provide a place to cross-reference the classification
number of a book with the name of the author or the book title.
Databases are also able to solve this problem with nonclustered
indexes.
In a nonclustered index , columns are selected and sorted based on
their values. These columns contain a reference to the heap or clustered
index location of the data they are related to. This is nearly identical to
how a card catalog works in a library. The order of the books, or the
records in the tables, doesn’t change, but a shortcut to the data is
created based on the other search criteria.
Nonclustered indexes do not have the same restrictions as heaps
and clustered indexes. There can be many nonclustered indexes on a
table, in fact up to 999 nonclustered indexes. This allows alternative
routes to be created for users to get to the data they need without
having to traverse all records in a table. Just because a table can have
many indexes doesn’t mean that it should, as I’ll discuss later in this
book.
Columnstore Indexes
One of the problems with card catalogs in large libraries is that there
could be dozens or hundreds of index cards that match a title of a book.
Each of these index cards contains information such as the author,
subject, title, International Standard Book Number (ISBN), page count,
and publishing date, along with the Dewey Decimal number. In nearly
all cases, this additional information is not needed, but it’s there to help
filter out index cards when necessary.
Imagine if instead of dozens or hundreds of index cards to look at,
you had a few cards that had only the title and Dewey Decimal number
or only the subject and Dewey Decimal number. Basically, instead of
storing all attributes together, you stored them separately with an
identifier, like a Dewey Decimal number, included to link them back
together again. For each attribute, where you previously would have
had to look through dozens or hundreds of index cards, you instead are
left with a few consolidated index cards. This type of index would be
called a columnstore index .
Columnstore indexes were new to SQL Server 2012 and greatly
expanded in following SQL Server releases. Traditionally, indexes are
stored in row-based organization, also known as rowstore. This form of
storage is extremely efficient when one row or a small range is
requested. When a large range or all rows are returned, rowstores can
become inefficient, especially when there are aggregations or few
columns are required. The columnstore index favors the return of large
ranges of rows by storing data in column-wise organization.
When you create a columnstore index, you include all the columns
in a table. This ensures that all columns are included in the enhanced
performance benefits of the columnstore organization. In a
columnstore index, instead of storing all the columns for a record
together, each column is stored separately with all the other rows in an
index. The benefit of this type of index is that only the columns and
rows required for a query need to be read. In data warehousing
scenarios, often less than 15 percent of the columns in an index are
needed for the results of a query.1
Because of their structure, columnstore indexes provide significant
value for data warehousing. Consider first that the index accesses only
the columns required to execute the query. Additionally, compression is
greatly improved since data within a single column has a higher
likelihood for similarity. Between these two aspects, columnstore
indexes provide significant performance improvements. I’ll discuss
these in more depth in later chapters.
Other Index Types
Besides the index types just discussed, a number of other index types
are available. These other types cover specialized search, data, and
table types that don’t fit under traditional indexing structures. These
types, which are XML, spatial, hash and range, and full-text search (FTS)
indexes, each have dedicated chapters to focus on their specialized
indexing structures. While these don’t necessarily fit into the card
catalog scenario that has been outlined so far, they are important
options when working with their related data and table types. To help
illustrate, I’ll show how to add some new functionality to the library.
Later chapters will further expand on the information presented here.
JSON and XML Indexes
Suppose you needed a method to be able to search the table of contents
for all the books in the library. A table of contents provides a
hierarchical view of a book. There are chapters that outline the main
sections for the book, which are followed by subchapter heads that
provide more details of the contents of the chapter. This relationship
model is similar to how XML documents are designed; there are nodes
and a relation between them that define the structure of the
information.
As discussed with the card catalog, it would not be efficient to look
through every book in the library to find those that were written by
Jason Strate. It would be even less efficient to look through all the books
in the library to find out whether any of the chapters in any of the
books were written by Ted Krueger. Each book probably has more than
one chapter, resulting in multiple values that would need to be checked
for each book and no certainty as to how many chapters would need to
be looked at before checking.
One method of solving this problem would be to make a list of every
book in the library and list all the chapters for each book. Each book
would have one or more chapter entries in the list. This provides the
Another Random Scribd Document
with Unrelated Content
there used to be home from school, to get the first chance at the new
book!
It was as good as a fortune to us, and all for six and a quarter
cents a week! In this way I read the novels of Richardson, Madame
D’Arblay, Fielding, Smollett, Cooper, Scott, Captain Marryatt, and
many another old book not included in Mr. Ruskin’s list of “one
hundred good books.” Passing through the alembic of a child’s pure
mind, I am not now conscious that the reading of the doubtful ones
did me any lasting harm. But I should add that I do not advise such
indiscriminate reading among young people, and there is no need of
it, since now there are so many good books, easy of access, which
have not the faults of those I was obliged to read. Then, there was
no choice. To-day, the best of reading, for children and young
people, can be found everywhere.
“Lalla Rookh” was the first poem I ever read, and it awoke in me,
not only a love of poetry, but also a desire to try my own hand at
verse-making.
And so the process of education went on, and I, with many
another “little doffer,” had more than one chance to nibble at the root
of knowledge. I had been to school for three months in each year,
until I was about thirteen years old, when my mother, who was now a
little better able to do without my earnings, sent me to the Lowell
High School regularly for two years, adding her constant injunction,
“Improve your mind, try and be somebody.” There I was taught a little
of everything, including French and Latin; and I may say here that
my “little learning,” in French at least, proved “a dangerous thing,” as
I had reason to know some years later, when I tried to speak my
book-French in Paris, for it might as well have been Choctaw, when
used as a means of oral communication with the natives of that
fascinating city.
The Lowell high school, in about 1840, was kept in a wooden
building over a butcher’s shop, but soon afterwards the new high
school, still in use, was provided, and it was co-educational. How
well I remember some of the boys and girls, and I recall them with
pleasure if not with affection. I could name them now, and have
noted with pride their success in life. A few are so high above the
rest that one would be surprised to know that they received the
principal part of their school education in that little high school room
over the butcher’s shop.
I left the high school when fifteen years of age, my school
education completed; though after that I took private lessons in
German, drawing, and dancing! About this time my elder brother and
I made up our minds that our mother had worked hard long enough,
and we prevailed on her to give up keeping boarders. This she did,
and while she remained in Lowell we supported the home by our
earnings. I was obliged to have my breakfast before daylight in the
winter. My mother prepared it over night, and while I was cooking
and eating it I read such books as Stevens’s “Travels” in Yucatan
and in Mexico, Tasso’s “Jerusalem Delivered,” and “Lights and
Shadows of Scottish Life.” My elder brother was the clerk in the
counting-room of the Tremont Corporation, and the agent, Mr.
Charles L. Tilden,—whom I thank, wherever he may be,—allowed
him to carry home at night, or over Sunday, any book that might be
left on his (the agent’s) desk; by this means I read many a beloved
volume of poetry, late into the night and on Sunday. Longfellow, in
particular, I learned almost by heart, and so retentive is the young
memory that I can repeat, even now, whole poems.
I read and studied also at my work; and as this was done by the
job, or beam, if I chose to have a book in my lap, and glance at it at
intervals, or even write a bit, nothing was lost to the “corporation.”
Lucy Larcom, in her “New England Girlhood,” speaks of the
windows in the mill on whose sides were pasted newspaper
clippings, which she calls “window gems.” It was very common for
the spinners and weavers to do this, as they were not allowed to
read books openly in the mill; but they brought their favorite “pieces”
of poetry, hymns, and extracts, and pasted them up over their looms
or frames, so that they could glance at them, and commit them to
memory. We little girls were fond of reading these clippings, and no
doubt they were an incentive to our thoughts as well as to those of
the older girls, who went to “The Improvement Circle,” and wrote
compositions.
A year or two after this I attempted poetry, and my verses began
to appear in the newspapers, in one or two Annuals, and later in The
Lowell Offering.
In 1846 I wrote some verses which were published in the Lowell
Journal, and these caused me to make the acquaintance of the sub-
editor of that paper, who afterwards became my life companion. I
speak of this here because, in my early married life, I found the exact
help that I needed for continued education,—the leisure to read good
books, sent to my husband for review, in the quiet of my secluded
home. For I had neither the gowns to wear nor the disposition to go
into society, and as my companion was not willing to go without me,
in the long evenings, when the children were in bed and I was busy
making “auld claes look amaist as good as new,” he read aloud to
me countless books on abstruse political and general subjects,
which I never should have thought of reading for myself.
These are the “books that have helped me.” In fact, of all the
books I have read, I remember but very few that have not helped
me. Thus I had the companionship of a mind more mature, wiser,
and less prone to unrealities than my own; and if it seems to the
reader that my story is that of one of the more fortunate ones among
the working-girls of my time, it is because of this needed help, which
I received almost at the beginning of my womanhood. And for this,
as well as for those early days of poverty and toil, I am devoutly and
reverently thankful.
The religious experience of a young person oftentimes forms a
large part of the early education or development; and mine is
peculiar, since I am one of the very few persons, in this country at
least, who have been excommunicated from a Protestant church.
And I cannot speak of this event without showing the strong
sectarian tendencies of the time.
As late as 1843-1845 Puritan orthodoxy still held sway over
nearly the whole of New England; and the gloomy doctrines of
Jonathan Edwards, now called his “philosophy,” held a mighty grasp
on the minds of the people, all other denominations being frowned
upon. The Episcopal church was considered “little better than the
Catholic,” and the Universalists and the Unitarians were treated with
even less tolerance by the “Evangelicals” than any sect outside
these denominations is treated to-day. The charge against the
Unitarians was that they did not believe all of the Bible, and that they
preached “mere morality rather than religion.”
My mother, who had sat under the preaching of the Rev. Paul
Dean, in Boston, had early drifted away from her hereditary church
and its beliefs; but she had always sent her children to the
Congregational church and Sunday-school, not wishing, perhaps, to
run the same risk for their souls that she was willing to take for her
own, thus keeping us on the “safe side,” as it was called, with regard
to our eternal salvation. Consequently, we were well taught in the
belief of a literal devil, in a lake of brimstone and fire, and in the
“wrath of a just God.”
The terrors of an imaginative child’s mind, into which these
monstrous doctrines were poured, can hardly be described, and their
lasting effect need not be dwelt upon. It was natural that young
people who had minds of their own should be attracted to the new
doctrine of a Father’s love, as well as to the ministers who preached
it; and thus in a short time the mill girls and boys made a large part
of the congregation of those “unbelieving” sects which had come to
disturb the “ancient solitary reign” of primitive New England
orthodoxy.
I used often to wish that I could go to the Episcopal Sunday-
school, because their little girls were not afraid of the devil, were
allowed to dance, and had so much nicer books in their Sunday-
school library. “Little Henry and his Bearer,” and “The Lady of the
Manor,” in which was the story of “The Beautiful Estelle,” were lent to
me; and the last-named was a delight and an inspiration. But the
little “orthodox” girls were not allowed to read even religious novels;
and one of my work-mates, whose name would surprise the reader,
and who afterwards outgrew such prejudices, took me to task for
buying a paper copy of Scott’s “Redgauntlet,” saying, “Why, Hattie,
do you not know that it is a novel?”
We had frequent discussions among ourselves on the different
texts of the Bible, and debated such questions as, “Is it a sin to read
novels?” “Is it right to read secular books on Sunday?” or, “Is it
wicked to play cards or checkers?” By this it will be seen that we
were made more familiar with the form, than with the spirit or the
teaching, of Christianity.
In the spring of 1840 there was a great revival in Lowell, and
some of the little girls held prayer-meetings, after school, at each
other’s houses, and many of them “experienced religion.” I went
sometimes to these meetings, and one night, when I was walking
home by starlight, for the days were still short, one of the older girls
said to me, “Are you happy?” “Do you love Jesus?” “Do you want to
be saved?”—“Why, yes,” I answered. “Then you have experienced
religion,” said the girl; “you are converted.” I was startled at the idea,
but did not know how to deny it, and I went home in an exalted state
of feeling; and, as I looked into the depths of the heavens above me,
there came to my youthful mind the first glimmer of thought on
spiritual themes.
It was an awakening, but not a conversion, for I had been
converted from nothing to nothing. I was at once claimed as a
“young convert,” went to the church prayer-meeting, told my
“experience” as directed, and was put on probation for admission to
the church. Meanwhile, I had been advised not to ask my mother’s
consent to this step, because she was a Universalist, and might
object. But I did not follow this advice; and when I told her of my
desire, she simply answered, “If you think it will make you any
happier, do so, but I do not believe you will be satisfied.” I have
always been very thankful to my mother for giving me this freedom in
my young life,—
“Not to be followed hourly, watched and noosed,”—
this chance in such an important matter to learn to think and to act
for myself. In fact, she always carried out this principle, and never to
my recollection coerced her children on any important point, but
taught them to “see for themselves.”
When the day came for me to be admitted into the church, I, with
many other little girls, was sprinkled; and, when I stood up to repeat
the creed, I can truly say that I knew no more what were the
doctrines to which I was expected to subscribe, than I did about the
Copernican System or the Differential Calculus. And I might have
said, with the disciples at Ephesus, I “have not so much as heard
whether there be any Holy Ghost.” For, although I had been regularly
to church and to Sunday-school, I had never seen the Articles of
Belief, nor had I been instructed concerning the doctrines, or the
sacredness of the vow I was about to take upon me. Nor, from the
frequent backsliding among the young converts, do I think my case
was a singular one, although, so far as I know, I was the only one
who backslid enough to be excommunicated.
And later, when I was requested to subscribe to the Articles of
Belief, I found I could not accept them, particularly a certain part,
which related to the day of judgment and what would follow
thereafter. I have reviewed this document, and am able to quote the
exact words which were a stumbling-block to me. “We believe ... that
at the day of judgment the state of all will be unalterably fixed, and
that the punishment of the wicked and the happiness of the righteous
will be endless.”
When the service was over, I went home, feeling as if I had done
something wrong. I thought of my mother, whom my church people
called an “unbeliever;” of my dear little brother who had been
drowned, and whose soul might be lost, and I was most unhappy.
In fact, so serious was I for many days, that no doubt my church
friends thought me a most promising young convert.
Indeed I was converted, but not in the way they supposed; for I
had begun to think on religious subjects, and the more I thought the
less I believed in the doctrines of the church to which I belonged.
Doubts of the goodness of God filled my mind, and unbelief in the
Father’s love and compassion darkened my young life. What a
conversion! The beginning of long years of doubt and of struggle in
search of spiritual truths.
After a time I went no more to my church meetings, and began to
attend those of the Universalists; but, though strongly urged, as a
“come-outer,” to join that body, I did not do so, being fearful of
subscribing to a belief whose mysteries I could neither understand
nor explain.
Hearing that I was attending the meetings of another
denomination, my church appointed three persons, at least one of
whom was a deacon, to labor with me. They came to our house one
evening, and, while my mother and I sat at our sewing, they plied me
with questions relating to my duty as a church member, and
arguments concerning the articles of belief; these I did not know how
to answer, but my mother, who had had some experience in
“religious” disputes, gave text for text, and I remember that, although
I trembled at her boldness, I thought she had the best of it.
Meanwhile, I sat silent, with downcast eyes, and when they
threatened me with excommunication if I did not go to the church
meetings, and “fulfil my covenant,” I mustered up courage to say,
with shaking voice, “I do not believe; I cannot go to your church,
even if you do excommunicate me.”
When my Universalist friends heard of this threat of
excommunication, they urged the preparation of a letter to the
church, giving my reasons for non-attendance; and this was
published in a Lowell newspaper, July 30, 1842. In this letter, which
my elder brother helped me to prepare,—in fact, I believe wrote the
most of it,—several arguments against the Articles of Belief are
given; and the letter closes with a request to “my brothers and
sisters,” to erase my name from “your church books rather than to
follow your usual course, common in cases similar to my own, to
excommunicate the heretic.”
This request was not heeded, and shortly after a committee of
three was “then appointed to take farther steps;” and this committee
reported that they had “visited and admonished” me without success;
and in November, 1842, the following vote was passed, and is
recorded in the church book:—
“Nov. 21, 1842.
Whereas, it appears that Miss Harriet Hanson has violated her
covenant with this church,—first, by repeated and regular absence
from the ordinances of the gospel, second, by embracing sentiments
deemed by this church heretical; and whereas, measures have been
taken to reclaim her, but ineffectual; therefore,
Voted, that we withdraw our fellowship from the said Miss Hanson
until she shall give satisfactory evidence of repentance.”
And thus, at seventeen years of age, I was excommunicated from
the church of my ancestors, and for no fault, no sin, no crime, but
simply because I could not subscribe conscientiously to doctrines
which I did not comprehend. I relate this phase of my youthful
experience here in detail, because it serves to show the methods
which were then in use to cast out or dispose of those members who
could not subscribe to the doctrines of the dominant church of New
England.
For some time after this, I was quite in disgrace with some of my
work-mates, and was called a “heretic” and a “child of perdition” by
my church friends. But, as I did not agree, even in this, with their
opinions, but went my “ain gait,” it followed that, although I remained
for a time something of a heretic, I was not an unbeliever in sacred
things nor did I prove to be a “child of perdition.” But this experience
made me very unhappy, and gave me a distaste for religious reading
and thinking, and for many years the Bible was a sealed book to me,
until I came to see in the Book, not the letter of dogma, but rather the
spirit of truth and of revelation. This experience also repressed the
humorous side of my nature, which is every one’s birthright, and
made me for a time a sort of youthful cynic; and I allowed myself to
feel a certain contempt for those of my work-mates who, though they
could not give clear reason for their belief, still remained faithful to
their “covenant.”
There were two or three little incidents connected with this
episode in my life that may be of interest. A little later, when I thought
of applying for the position of teaching in a public school, I was
advised by a well-meaning friend not to attempt it, “for,” the friend
added, “you will not succeed, for how can a Universalist pray in her
school?”
Several years after my excommunication, when I had come to
observe that religion and “mere morality” do not always go together, I
had a final interview with one of the deacons who had labored with
me. He was an overseer in the room where I worked, and I had
noticed his familiar manner with some of the girls, who did not like it
any better than I did; and one day, when his behavior was unusually
offensive, I determined to speak to him about it.
I called him to my drawing-in frame, where I was sitting at work,
and said to him something like this: “I have hard work to believe that
you are one of those deacons who came to labor with a young girl
about belonging to your church. I don’t think you set the example of
good works you then preached to me.” He gave me a look, but did
not answer; and shortly after, as I might have expected, I received an
“honorable discharge” from his room.
But let me acknowledge one far-reaching benefit that resulted
from my being admitted to the Orthodox church, a benefit which
came to me in the summer of 1895. Because of my baptism,
administered so long ago, I was enabled to officiate as god-mother
to my grandchild and namesake, in Pueblo, Colorado,—one among
the first of the little girls born on a political equality with the little boys
of that enlightened State, born, as one may say, with the ballot in her
hand! And to any reader who has an interest in the final result of my
religious experience, I may add, that, as late as 1898, I became a
communicant of the Episcopal Church.
When the time came for me to become engaged to the man of my
choice, having always believed in the old-fashioned idea that there
should be no secrets between persons about to marry, I told him,
among my other shortcomings, as the most serious of all, the story
of my excommunication. To my great surprise, he laughed heartily,
derided the whole affair, and wondered at the serious view I had
always taken of it; and later he enjoyed saying to some of his
gentlemen friends, as if it were a good joke, “Did you know my wife
had been excommunicated from the church?”
And I too, long since have learned, that no creed—
“Can fix our doom,
Nor stay the eternal Love from His intent,
While Hope remaining bears her verdant bloom.”
CHAPTER IV.
THE CHARACTERISTICS OF THE EARLY
FACTORY GIRLS.
When I look back into the factory life of fifty or sixty years ago, I
do not see what is called “a class” of young men and women going
to and from their daily work, like so many ants that cannot be
distinguished one from another; I see them as individuals, with
personalities of their own. This one has about her the atmosphere of
her early home. That one is impelled by a strong and noble purpose.
The other,—what she is, has been an influence for good to me and
to all womankind.
Yet they were a class of factory operatives, and were spoken of
(as the same class is spoken of now) as a set of persons who
earned their daily bread, whose condition was fixed, and who must
continue to spin and to weave to the end of their natural existence.
Nothing but this was expected of them, and they were not supposed
to be capable of social or mental improvement. That they could be
educated and developed into something more than mere work-
people, was an idea that had not yet entered the public mind. So
little does one class of persons really know about the thoughts and
aspirations of another! It was the good fortune of these early mill-
girls to teach the people of that time that this sort of labor is not
degrading; that the operative is not only “capable of virtue,” but also
capable of self-cultivation.
At the time the Lowell cotton-mills were started, the factory girl
was the lowest among women. In England, and in France
particularly, great injustice had been done to her real character; she
was represented as subjected to influences that could not fail to
destroy her purity and self-respect. In the eyes of her overseer she
was but a brute, a slave, to be beaten, pinched, and pushed about. It
was to overcome this prejudice that such high wages had been
offered to women that they might be induced to become mill-girls, in
spite of the opprobrium that still clung to this “degrading occupation.”
At first only a few came; for, though tempted by the high wages to be
regularly paid in “cash,” there were many who still preferred to go on
working at some more genteel employment at seventy-five cents a
week and their board.
But in a short time the prejudice against factory labor wore away,
and the Lowell mills became filled with blooming and energetic New
England women. They were naturally intelligent, had mother-wit, and
fell easily into the ways of their new life. They soon began to
associate with those who formed the community in which they had
come to live, and were invited to their houses. They went to the
same church, and sometimes married into some of the best families.
Or if they returned to their secluded homes again, instead of being
looked down upon as “factory girls” by the squire’s or the lawyer’s
family, they were more often welcomed as coming from the
metropolis, bringing new fashions, new books, and new ideas with
them.
In 1831 Lowell was little more than a factory village. Several
corporations were started, and the cotton-mills belonging to them
were building. Help was in great demand; and stories were told all
over the country of the new factory town, and the high wages that
were offered to all classes of work-people,—stories that reached the
ears of mechanics’ and farmers’ sons, and gave new life to lonely
and dependent women in distant towns and farmhouses. Into this
Yankee El Dorado, these needy people began to pour by the various
modes of travel known to those slow old days. The stage-coach and
the canal-boat came every day, always filled with new recruits for
this army of useful people. The mechanic and machinist came, each
with his home-made chest of tools, and oftentimes his wife and little
ones. The widow came with her little flock and her scanty
housekeeping goods to open a boarding-house or variety store, and
so provided a home for her fatherless children. Many farmers’
daughters came to earn money to complete their wedding outfit, or
buy the bride’s share of housekeeping articles.
Women with past histories came, to hide their griefs and their
identity, and to earn an honest living in the “sweat of their brow.”
Single young men came, full of hope and life, to get money for an
education, or to lift the mortgage from the home-farm. Troops of
young girls came by stages and baggage-wagons, men often being
employed to go to other States and to Canada, to collect them at so
much a head, and deliver them at the factories.
A very curious sight these country girls presented to young eyes
accustomed to a more modern style of things. When the large
covered baggage-wagon arrived in front of a block on the
corporation, they would descend from it, dressed in various and
outlandish fashions, and with their arms brimful of bandboxes
containing all their worldly goods. On each of these was sewed a
card, on which one could read the old-fashioned New England name
of the owner. And sorrowful enough they looked, even to the fun-
loving child who has lived to tell the story; for they had all left their
pleasant country homes to try their fortunes in a great manufacturing
town, and they were homesick even before they landed at the doors
of their boarding-houses. Years after, this scene dwelt in my
memory; and whenever anyone said anything about being homesick,
there rose before me the picture of a young girl with a sorrowful face
and a big tear in each eye, clambering down the steps at the rear of
a great covered wagon, holding fast to a cloth-covered bandbox,
drawn up at the top with a string, on which was sewed a paper
bearing the name of Plumy Clay!
Some of these girls brought diminutive hair trunks covered with
the skin of calves, spotted in dun and white, even as when they did
skip and play in daisy-blooming meads. And when several of them
were set together in front of one of the blocks, they looked like their
living counterparts, reposing at noontide in the adjacent field. One of
this kind of trunks has been handed down to me as an heirloom. The
hair is worn off in patches; it cannot be invigorated, and it is now
become a hairless heirloom. Within its hide-bound sides are safely
stowed away the love-letters of a past generation,—love-letters that
agitated the hearts of the grandparents of to-day; and I wonder that
their resistless ardor has not long ago burst its wrinkled sides. It is
relegated to distant attics, with its ancient crony, “ye bandbox,” to
enjoy an honored and well-earned repose.
Ah me! when some of us, its contemporaries, are also past our
usefulness, gone clean out of fashion, may we also be as resigned,
yea, as willing, to be laid quietly on some attic shelf!
These country girls had queer names, which added to the
singularity of their appearance. Samantha, Triphena, Plumy, Kezia,
Aseneth, Elgardy, Leafy, Ruhamah, Lovey, Almaretta, Sarepta, and
Florilla were among them.
Their dialect was also very peculiar. On the broken English and
Scotch of their ancestors was ingrafted the nasal Yankee twang; so
that many of them, when they had just come daown, spoke a
language almost unintelligible. But the severe discipline and ridicule
which met them was as good as a school education, and they were
soon taught the “city way of speaking.”
Their dress was also peculiar, and was of the plainest of
homespun, cut in such an old-fashioned style that each young girl
looked as if she had borrowed her grandmother’s gown. Their only
head-covering was a shawl, which was pinned under the chin; but
after the first pay-day, a “shaker” (or “scooter”) sunbonnet usually
replaced this primitive head-gear of their rural life.
But the early factory girls were not all country girls. There were
others also, who had been taught that “work is no disgrace.” There
were some who came to Lowell solely on account of the social or
literary advantages to be found there. They lived in secluded parts of
New England, where books were scarce, and there was no
cultivated society. They had comfortable homes, and did not perhaps
need the money they would earn; but they longed to see this new
“City of Spindles,” of which they had heard so much from their
neighbors and friends, who had gone there to work.
And the fame of the circulating libraries, that were soon opened,
drew them and kept them there, when no other inducement would
have been sufficient.
The laws relating to women were such, that a husband could
claim his wife wherever he found her, and also the children she was
trying to shield from his influence; and I have seen more than one
poor woman skulk behind her loom or her frame when visitors were
approaching the end of the aisle where she worked. Some of these
were known under assumed names, to prevent their husbands from
trusteeing their wages. It was a very common thing for a male
person of a certain kind to do this, thus depriving his wife of all her
wages, perhaps, month after month. The wages of minor children
could be trusteed, unless the children (being fourteen years of age)
were given their time. Women’s wages were also trusteed for the
debts of their husbands, and children’s for the debts of their parents.
As an instance, my mother had some financial difficulties when I
was fifteen years old, and to save herself and me from annoyance,
she gave me my time. The document reads as follows:—
“Be it known that I, Harriet Hanson, of Lowell, in consideration
that my minor daughter Harriet J. has taken upon herself the whole
burden of her own support, and has undertaken and agreed to
maintain herself henceforward without expense to me, do hereby
release and quitclaim unto her all profits and wages which she may
hereafter earn or acquire by her skill or labor in any occupation,—
and do hereby disclaim all right to collect or interfere with the same.
And I do give and release unto her the absolute control and disposal
of her own time according to her own discretion, without interference
from me. It being understood that I am not to be chargeable
hereafter with any expense on her account.
(Signed) Harriet Hanson.
July 2, 1840.”
It must be remembered that at this date woman had no property
rights. A widow could be left without her share of her husband’s (or
the family) property, a legal “incumbrance” to his estate. A father
could make his will without reference to his daughter’s share of the
inheritance. He usually left her a home on the farm as long as she
remained single. A woman was not supposed to be capable of
spending her own or of using other people’s money. In
Massachusetts, before 1840, a woman could not legally be treasurer
of her own sewing-society, unless some man were responsible for
her.
The law took no cognizance of woman as a money-spender. She
was a ward, an appendage, a relict. Thus it happened, that if a
woman did not choose to marry, or, when left a widow, to re-marry,
she had no choice but to enter one of the few employments open to
her, or to become a burden on the charity of some relative.
In almost every New England home could be found one or more
of these women, sometimes welcome, more often unwelcome, and
leading joyless, and in many instances unsatisfactory, lives. The
cotton-factory was a great opening to these lonely and dependent
women. From a condition approaching pauperism they were at once
placed above want; they could earn money, and spend it as they
pleased; and could gratify their tastes and desires without restraint,
and without rendering an account to anybody. At last they had found
a place in the universe; they were no longer obliged to finish out their
faded lives mere burdens to male relatives. Even the time of these
women was their own, on Sundays and in the evening after the day’s
work was done. For the first time in this country woman’s labor had a
money value. She had become not only an earner and a producer,
but also a spender of money, a recognized factor in the political
economy of her time. And thus a long upward step in our material
civilization was taken; woman had begun to earn and hold her own
money, and through its aid had learned to think and to act for herself.
Among the older women who sought this new employment were
very many lonely and dependent ones, such as used to be
mentioned in old wills as “incumbrances” and “relicts,” and to whom
a chance of earning money was indeed a new revelation. How well I
remember some of these solitary ones! As a child of eleven years, I
often made fun of them—for children do not see the pathetic side of
human life—and imitated their limp carriage and inelastic gait. I can
see them now, even after sixty years, just as they looked,—
depressed, modest, mincing, hardly daring to look one in the face, so
shy and sylvan had been their lives. But after the first pay-day came,
and they felt the jingle of silver in their pockets, and had begun to
feel its mercurial influence, their bowed heads were lifted, their necks
seemed braced with steel, they looked you in the face, sang blithely
among their looms or frames, and walked with elastic step to and
from their work. And when Sunday came, homespun was no longer
their only wear; and how sedately gay in their new attire they walked
to church, and how proudly they dropped their silver fourpences into
the contribution-box! It seemed as if a great hope impelled them,—
the harbinger of the new era that was about to dawn for them and for
all women-kind.
In passing, let me not forget to pay a tribute, also, to those noble
single and widowed women, who are “set solitary in families,” but
whose presence cements the domestic fabric, and whose influence
is unseen and oftentimes unappreciated, until they are taken away
and the integral part of the old home-life begins to crumble.
Except in rare instances, the rights of the early mill-girls were
secure. They were subject to no extortion, if they did extra work they
were always paid in full, and their own account of labor done by the
piece was always accepted. They kept the figures, and were paid
accordingly. This was notably the case with the weavers and
drawing-in girls. Though the hours of labor were long, they were not
over-worked; they were obliged to tend no more looms and frames
than they could easily take care of, and they had plenty of time to sit
and rest. I have known a girl to sit idle twenty or thirty minutes at a
time. They were not driven, and their work-a-day life was made easy.
They were treated with consideration by their employers, and there
was a feeling of respectful equality between them. The most favored
of the girls were sometimes invited to the houses of the dignitaries of
the mills, showing that the line of social division was not rigidly
maintained.
Their life in the factory was made pleasant to them. In those days
there was no need of advocating the doctrine of the proper relation
between employer and employed. Help was too valuable to be ill-
treated. If these early agents, or overseers, had been disposed to
exercise undue authority, or to establish unjust or arbitrary laws, the
high character of the operatives, and the fact that women employees
were scarce would have prevented it. A certain agent of one of the
first corporations in Lowell (an old sea-captain) said to one of his
boarding-house keepers, “I should like to rule my help as I used to
rule my sailors, but so many of them are women I do not dare to do
it.”
The knowledge of the antecedents of these operatives was the
safeguard of their liberties. The majority of them were as well born
as their “overlookers,” if not better; and they were also far better
educated.
The agents and overseers were usually married men, with
families of growing sons and daughters. They were members, and
sometimes deacons, of the church, and teachers in the same
Sunday-school with the girls employed under them. They were
generally of good morals and temperate habits, and often exercised
a good influence over their help. The feeling that the agents and
overseers were interested in their welfare caused the girls, in turn, to
feel an interest in the work for which their employers were
responsible. The conscientious among them took as much pride in
spinning a smooth thread, drawing in a perfect web, or in making
good cloth, as they would have done if the material had been for
their own wearing. And thus was practised, long before it was
preached, that principle of true political economy,—the just relation,
the mutual interest, that ought to exist between employers and
employed.
Those of the mill-girls who had homes generally worked from
eight to ten months in the year; the rest of the time was spent with
parents or friends. A few taught school during the summer months.
When we left the mill, or changed our place of work from one
corporation to another, we were given an “honorable discharge.”
Mine, of which I am still quite proud, is dated the year of my
marriage, and is as follows:—
“Harriet J. Hanson has been employed in the Boott Cotton
Mills, in a dressing-room, twenty-five months, and is honorably
discharged.
(Signed) J. F. Trott.
Lowell, July 25, 1848.”
The chief characteristics of the early mill-girls may be briefly
mentioned, as showing the material of which this new community of
working-women was composed. Concerning their personal
appearance, I am able to quote from a magazine article written by
the poet John G. Whittier, then a resident of Lowell. He thus
describes,—
“THE FACTORY GIRLS OF LOWELL.
“Acres of girlhood, beauty reckoned by the square rod,—or miles
by long measure! the young, the graceful, the gay,—the flowers
gathered from a thousand hillsides and green valleys of New
England, fair unveiled Nuns of Industry, Sisters of Thrift, and are ye
not also Sisters of Charity dispensing comfort and hope and
happiness around many a hearthstone of your native hills, making
sad faces cheerful, and hallowing age and poverty with the sunshine
of your youth and love! Who shall sneer at your calling? Who shall
count your vocation otherwise than noble and ennobling?”
Of their literary and studious habits, Professor A. P. Peabody, of
Harvard University, gives his opinion in an article written not long ago
in the Atlantic Monthly. He says, “During the palmy days of The
Lowell Offering I used every winter to lecture for the Lowell Lyceum.
Not amusement, but instruction, was then the lecturer’s aim.... The
Lowell Hall was always crowded, and four-fifths of the audience were
factory-girls. When the lecturer entered, almost every girl had a book
in her hand, and was intent upon it. When he rose, the book was laid
aside, and paper and pencil taken instead; and there were very few
who did not carry home full notes of what they had heard. I have
never seen anywhere so assiduous note-taking. No, not even in a
college class, ... as in that assembly of young women, laboring for
their subsistence.”
To introduce a more practical side of their character I will quote an
extract from a letter received not long ago from a gentleman in the
Detroit Public Library, which says, “The factory-girls went to Lowell
from the hills of Vermont when I was a boy, numbers of them from
every town in my county (Windsor); and it was considered something
of a distinction to have worked for ‘the corporation,’ and brought
home some hard cash, which in many and many cases went to help
lift a mortgage on the farm, or to buy something needed for the
comfort of the old folks, or to send a younger brother or sister to the
Academy. I knew several of these girls who brought home purses
from Lowell which looked big in those days, and I recall one who is
still living in my native town of Pomfret.”
It may be added here, that the majority of the mill-girls made just
as good use of their money, so newly earned, and of whose value
they had hitherto known so little. They were necessarily industrious.
They were also frugal and saving. It was their custom on the first day
of every month, after paying their board-bill ($1.25 a week), to put
their wages in the savings-bank. There the money stayed, on
interest, until they withdrew it, to carry home or to use for a special
purpose. It is easy to see how much good this sum would do in a
rural community where money, as a means of exchange, had been
scarce. Into the barren homes many of them had left it went like a
quiet stream, carrying with it beauty and refreshment. The mortgage
was lifted from the homestead; the farmhouse was painted; the barn
rebuilt; modern improvements (including Mrs. Child’s “Frugal
Housewife”—the first American cook-book) were introduced into the
mother’s kitchen, and books and newspapers began to ornament the
sitting-room table.
Some of the mill-girls helped maintain widowed mothers, or
drunken, incompetent, or invalid fathers. Many of them educated the
younger children of the family, and young men were sent to college
with the money furnished by the untiring industry of their women
relatives.
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!
textbookfull.com