100% found this document useful (4 votes)
109 views76 pages

Download ebooks file PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries 2nd Edition Dombrovskaya all chapters

Query

Uploaded by

gabtamaotwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
109 views76 pages

Download ebooks file PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries 2nd Edition Dombrovskaya all chapters

Query

Uploaded by

gabtamaotwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

Download Full Version ebookmass - Visit ebookmass.

com

PostgreSQL Query Optimization: The Ultimate Guide


to Building Efficient Queries 2nd Edition
Dombrovskaya

https://ebookmass.com/product/postgresql-query-optimization-
the-ultimate-guide-to-building-efficient-queries-2nd-
edition-dombrovskaya/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmass.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

PostgreSQL Query Optimization: The Ultimate Guide to


Building Efficient Queries 2 / converted Edition Henrietta
Dombrovskaya
https://ebookmass.com/product/postgresql-query-optimization-the-
ultimate-guide-to-building-efficient-queries-2-converted-edition-
henrietta-dombrovskaya/
ebookmass.com

The Ultimate Guide to Functions in Power Query Omid


Motamedisedeh

https://ebookmass.com/product/the-ultimate-guide-to-functions-in-
power-query-omid-motamedisedeh/

ebookmass.com

The Ultimate Guide to Functions in Power Query: Turn Raw


Data into Actionable Insights 1st Edition Omid
Motamedisedeh
https://ebookmass.com/product/the-ultimate-guide-to-functions-in-
power-query-turn-raw-data-into-actionable-insights-1st-edition-omid-
motamedisedeh/
ebookmass.com

Revaluing Roman Cyprus: Local Identity on an Island in


Antiquity Ersin Hussein

https://ebookmass.com/product/revaluing-roman-cyprus-local-identity-
on-an-island-in-antiquity-ersin-hussein/

ebookmass.com
Flow: The Rhythmic Voice in Rap Music Mitchell Ohriner

https://ebookmass.com/product/flow-the-rhythmic-voice-in-rap-music-
mitchell-ohriner/

ebookmass.com

The John Also Called Mark: Reception and Transformation in


Christian Tradition (Wissenschaftliche Untersuchungen Zum
Neuen Testament, 2. Reihe) Dean Furlong
https://ebookmass.com/product/the-john-also-called-mark-reception-and-
transformation-in-christian-tradition-wissenschaftliche-
untersuchungen-zum-neuen-testament-2-reihe-dean-furlong/
ebookmass.com

eTextbook 978-0134019192 Microbiology with Diseases by


Taxonomy

https://ebookmass.com/product/etextbook-978-0134019192-microbiology-
with-diseases-by-taxonomy/

ebookmass.com

Sparks & Taylor’s Nursing Diagnosis Reference Manual 10th


Edition, (Ebook PDF)

https://ebookmass.com/product/sparks-taylors-nursing-diagnosis-
reference-manual-10th-edition-ebook-pdf/

ebookmass.com

The Ecological and Societal Consequences of Biodiversity


Loss 1st Edition Forest Isbell

https://ebookmass.com/product/the-ecological-and-societal-
consequences-of-biodiversity-loss-1st-edition-forest-isbell/

ebookmass.com
Jerry John Rawlings: Leadership and Legacy: A Pan-African
Perspective Felix Kumah-Abiwu

https://ebookmass.com/product/jerry-john-rawlings-leadership-and-
legacy-a-pan-african-perspective-felix-kumah-abiwu/

ebookmass.com
PostgreSQL Query
Optimization
The Ultimate Guide to Building
Efficient Queries
Second Edition

Henrietta Dombrovskaya
Boris Novikov
Anna Bailliekova
PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries,
Second Edition
Henrietta Dombrovskaya Boris Novikov
DRW Holdings, Chicago, IL, USA Database expert, Helsinki, Finland
Anna Bailliekova
UrbanFootprint, Milwaukee, Wisconsin, USA

ISBN-13 (pbk): 979-8-8688-0068-9 ISBN-13 (electronic): 979-8-8688-0069-6


https://doi.org/10.1007/979-8-8688-0069-6

Copyright © 2024 by Henrietta Dombrovskaya, Boris Novikov, Anna Bailliekova


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.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Shaul Elson
Development Editor: Laura Berendson
Project Manager: Jessica Vakili
Cover designed by Straive
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@
springer-sbm.com, 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.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub. For more detailed information, please visit https://www.apress.com/gp/services/
source-code.
Paper in this product is recyclable
Table of Contents
About the Authors�������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv


Acknowledgments�������������������������������������������������������������������������������������������������xvii

Introduction������������������������������������������������������������������������������������������������������������xix

Chapter 1: Why Optimize?���������������������������������������������������������������������������������������� 1


What Do We Mean by Optimization?��������������������������������������������������������������������������������������������� 1
Why It Is Difficult: Imperative and Declarative������������������������������������������������������������������������������ 2
Optimization Goals������������������������������������������������������������������������������������������������������������������������ 6
Optimizing Processes�������������������������������������������������������������������������������������������������������������������� 7
Optimizing OLTP and OLAP������������������������������������������������������������������������������������������������������ 8
Database Design and Performance����������������������������������������������������������������������������������������� 9
Application Development and Performance�������������������������������������������������������������������������� 11
Other Stages of the Lifecycle������������������������������������������������������������������������������������������������ 11
PostgreSQL Specifics������������������������������������������������������������������������������������������������������������������ 12
Summary������������������������������������������������������������������������������������������������������������������������������������ 13

Chapter 2: Theory: Yes, We Need It!������������������������������������������������������������������������ 15


Query Processing Overview�������������������������������������������������������������������������������������������������������� 15
Compilation��������������������������������������������������������������������������������������������������������������������������� 15
Optimization and Execution��������������������������������������������������������������������������������������������������� 16
Relational, Logical, and Physical Operations������������������������������������������������������������������������������ 17
Relational Operations������������������������������������������������������������������������������������������������������������ 17
Logical Operations����������������������������������������������������������������������������������������������������������������� 21
Queries as Expressions: Thinking in Sets������������������������������������������������������������������������������ 22
Operations and Algorithms���������������������������������������������������������������������������������������������������� 23
Summary������������������������������������������������������������������������������������������������������������������������������������ 23
iii
Table of Contents

Chapter 3: Even More Theory: Algorithms�������������������������������������������������������������� 25


Algorithm Cost Models���������������������������������������������������������������������������������������������������������������� 25
Data Access Algorithms�������������������������������������������������������������������������������������������������������������� 27
Storage Structures���������������������������������������������������������������������������������������������������������������� 27
Full Scan�������������������������������������������������������������������������������������������������������������������������������� 28
Index-Based Table Access����������������������������������������������������������������������������������������������������� 29
Index-Only Scan�������������������������������������������������������������������������������������������������������������������� 31
Comparing Data Access Algorithms�������������������������������������������������������������������������������������� 32
Index Structures�������������������������������������������������������������������������������������������������������������������������� 34
What Is an Index?������������������������������������������������������������������������������������������������������������������ 34
B-Tree Indexes����������������������������������������������������������������������������������������������������������������������� 36
Why Are B-Trees Used So Often?������������������������������������������������������������������������������������������� 38
Other Kinds of Indexes���������������������������������������������������������������������������������������������������������� 39
Combining Relations������������������������������������������������������������������������������������������������������������������� 39
Nested Loops������������������������������������������������������������������������������������������������������������������������� 40
Hash-Based Algorithms��������������������������������������������������������������������������������������������������������� 42
Sort-Merge Algorithm������������������������������������������������������������������������������������������������������������ 43
Comparing Algorithms����������������������������������������������������������������������������������������������������������� 45
Summary������������������������������������������������������������������������������������������������������������������������������������ 45

Chapter 4: Understanding Execution Plans������������������������������������������������������������ 47


Putting Everything Together: How an Optimizer Builds an Execution Plan��������������������������������� 47
Reading Execution Plans������������������������������������������������������������������������������������������������������������� 48
Understanding Execution Plans�������������������������������������������������������������������������������������������������� 53
What Is Going On During Optimization?��������������������������������������������������������������������������������� 54
Why Are There So Many Execution Plans to Choose From?�������������������������������������������������� 55
How Are Execution Costs Calculated?����������������������������������������������������������������������������������� 56
How Can the Optimizer Be Led Astray?��������������������������������������������������������������������������������� 59
Summary������������������������������������������������������������������������������������������������������������������������������������ 60

iv
Table of Contents

Chapter 5: Short Queries and Indexes�������������������������������������������������������������������� 61


What Makes a Query “Short”?���������������������������������������������������������������������������������������������������� 62
Choosing Selection Criteria��������������������������������������������������������������������������������������������������������� 64
Index Selectivity�������������������������������������������������������������������������������������������������������������������� 64
Unique Indexes and Constraints�������������������������������������������������������������������������������������������� 66
Indexes and Non-equal Conditions��������������������������������������������������������������������������������������������� 70
Indexes and Column Transformations����������������������������������������������������������������������������������� 70
Indexes and the like Operator����������������������������������������������������������������������������������������������������� 75
Using Multiple Indexes���������������������������������������������������������������������������������������������������������������� 77
Compound Indexes��������������������������������������������������������������������������������������������������������������������� 78
How Do Compound Indexes Work?���������������������������������������������������������������������������������������� 78
Lower Selectivity������������������������������������������������������������������������������������������������������������������� 80
Using Indexes for Data Retrieval������������������������������������������������������������������������������������������� 81
Covering Indexes������������������������������������������������������������������������������������������������������������������� 82
Excessive Selection Criteria�������������������������������������������������������������������������������������������������������� 83
Partial Indexes���������������������������������������������������������������������������������������������������������������������������� 89
Indexes and Join Order��������������������������������������������������������������������������������������������������������������� 90
When Are Indexes Not Used�������������������������������������������������������������������������������������������������������� 94
Avoiding Index Usage������������������������������������������������������������������������������������������������������������ 94
Why Does PostgreSQL Ignore My Index?������������������������������������������������������������������������������� 94
Let PostgreSQL Do Its Job!��������������������������������������������������������������������������������������������������������� 97
How to Build the Right Index(es)����������������������������������������������������������������������������������������������� 101
To Build or Not to Build�������������������������������������������������������������������������������������������������������� 101
Which Indexes Are Needed?������������������������������������������������������������������������������������������������ 102
Which Indexes Are Not Needed?����������������������������������������������������������������������������������������� 102
Indexes and Short Query Scalability����������������������������������������������������������������������������������������� 103
Summary���������������������������������������������������������������������������������������������������������������������������������� 103

v
Table of Contents

Chapter 6: Long Queries and Full Scans��������������������������������������������������������������� 105


Which Queries Are Considered Long?��������������������������������������������������������������������������������������� 105
Long Queries and Full Scans���������������������������������������������������������������������������������������������������� 107
Long Queries and Hash Joins��������������������������������������������������������������������������������������������������� 108
Long Queries and the Order of Joins���������������������������������������������������������������������������������������� 109
What Is a Semi-join?����������������������������������������������������������������������������������������������������������� 109
Semi-joins and Join Order��������������������������������������������������������������������������������������������������� 111
More on Join Order�������������������������������������������������������������������������������������������������������������� 113
What Is an Anti-join?����������������������������������������������������������������������������������������������������������� 116
Semi- and Anti-joins Using the JOIN Operator�������������������������������������������������������������������� 118
When Is It Necessary to Specify Join Order?���������������������������������������������������������������������� 120
Grouping: Filter First, Group Last���������������������������������������������������������������������������������������������� 123
Grouping: Group First, Select Last��������������������������������������������������������������������������������������������� 131
Using SET Operations���������������������������������������������������������������������������������������������������������������� 134
Avoiding Multiple Scans������������������������������������������������������������������������������������������������������������ 138
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 145

Chapter 7: Long Queries: Additional Techniques�������������������������������������������������� 147


Structuring Queries������������������������������������������������������������������������������������������������������������������� 147
Temporary Tables and CTEs������������������������������������������������������������������������������������������������������ 148
Temporary Tables���������������������������������������������������������������������������������������������������������������� 148
Common Table Expressions (CTEs)�������������������������������������������������������������������������������������� 150
Views: To Use or Not to Use������������������������������������������������������������������������������������������������������ 155
Why Use Views?������������������������������������������������������������������������������������������������������������������ 162
Materialized Views�������������������������������������������������������������������������������������������������������������������� 162
Creating and Using Materialized Views������������������������������������������������������������������������������� 162
Refreshing Materialized Views�������������������������������������������������������������������������������������������� 164
Should I Create a Materialized View?���������������������������������������������������������������������������������� 164
Do Materialized Views Need to Be Optimized?�������������������������������������������������������������������� 167
Dependencies���������������������������������������������������������������������������������������������������������������������� 167
Partitioning�������������������������������������������������������������������������������������������������������������������������������� 168

vi
Table of Contents

Does Partitioning Improve Performance?��������������������������������������������������������������������������������� 170


Why Create a Partitioned Table?����������������������������������������������������������������������������������������������� 173
Parallelism�������������������������������������������������������������������������������������������������������������������������������� 173
Summary���������������������������������������������������������������������������������������������������������������������������������� 174

Chapter 8: Optimizing Data Modification�������������������������������������������������������������� 175


What Is DML?���������������������������������������������������������������������������������������������������������������������������� 175
Two Ways to Optimize Data Modification���������������������������������������������������������������������������������� 175
How Does DML Work?��������������������������������������������������������������������������������������������������������������� 176
Low-Level Input/Output������������������������������������������������������������������������������������������������������� 176
The Impact of Concurrency Control������������������������������������������������������������������������������������� 177
Data Modification and Indexes�������������������������������������������������������������������������������������������������� 180
DML and Vacuum���������������������������������������������������������������������������������������������������������������������� 181
Mass UPDATE/DELETE��������������������������������������������������������������������������������������������������������� 181
Frequent Updates���������������������������������������������������������������������������������������������������������������� 182
Referential Integrity and Triggers���������������������������������������������������������������������������������������������� 182
Summary���������������������������������������������������������������������������������������������������������������������������������� 183

Chapter 9: Design Matters������������������������������������������������������������������������������������ 185


Design Matters�������������������������������������������������������������������������������������������������������������������������� 185
Why Use a Relational Model?���������������������������������������������������������������������������������������������������� 189
Types of Databases������������������������������������������������������������������������������������������������������������� 190
Entity-Attribute-Value Model����������������������������������������������������������������������������������������������� 190
Key-Value Model������������������������������������������������������������������������������������������������������������������ 191
Hierarchical Model�������������������������������������������������������������������������������������������������������������� 192
Combining the Best of Different Worlds������������������������������������������������������������������������������ 193
Flexibility vs. Efficiency and Correctness���������������������������������������������������������������������������������� 193
Must We Normalize?����������������������������������������������������������������������������������������������������������������� 195
Use and Misuse of Surrogate Keys������������������������������������������������������������������������������������������� 197
Summary���������������������������������������������������������������������������������������������������������������������������������� 203

vii
Table of Contents

Chapter 10: What About Configuration Parameters?�������������������������������������������� 205


PostgreSQL Configuration Parameters Overview���������������������������������������������������������������������� 205
Memory Allocation��������������������������������������������������������������������������������������������������������������� 206
Connections and Sessions��������������������������������������������������������������������������������������������������� 206
Tuning Parameters for Better Performance������������������������������������������������������������������������������ 208
Are There Better Ways?������������������������������������������������������������������������������������������������������������� 213
Other Limitations of Parameter Tuning������������������������������������������������������������������������������������� 216
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 216

Chapter 11: Application Development and Performance�������������������������������������� 217


Response Time Matters������������������������������������������������������������������������������������������������������������ 217
World Wide Wait������������������������������������������������������������������������������������������������������������������������ 218
Performance Metrics���������������������������������������������������������������������������������������������������������������� 219
Impedance Mismatch���������������������������������������������������������������������������������������������������������������� 219
A Road Paved with Good Intentions������������������������������������������������������������������������������������������ 220
Application Development Patterns�������������������������������������������������������������������������������������� 220
“Shopping List Problem”����������������������������������������������������������������������������������������������������� 222
Interfaces���������������������������������������������������������������������������������������������������������������������������� 224
Welcome to the World of ORM��������������������������������������������������������������������������������������������� 225
In Search of a Better Solution��������������������������������������������������������������������������������������������������� 227
Summary���������������������������������������������������������������������������������������������������������������������������������� 230

Chapter 12: Functions������������������������������������������������������������������������������������������ 231


Function Creation���������������������������������������������������������������������������������������������������������������������� 231
Internal Functions���������������������������������������������������������������������������������������������������������������� 232
User-Defined Functions������������������������������������������������������������������������������������������������������� 232
Introducing Procedural Language��������������������������������������������������������������������������������������� 233
Dollar Quoting���������������������������������������������������������������������������������������������������������������������� 234
Function Parameters and Function Output: Void Functions������������������������������������������������� 235
Function Overloading����������������������������������������������������������������������������������������������������������� 235
Function Execution�������������������������������������������������������������������������������������������������������������������� 237
Function Execution Internals����������������������������������������������������������������������������������������������������� 240

viii
Table of Contents

Functions and Performance������������������������������������������������������������������������������������������������������ 243


How Using Functions Can Worsen Performance����������������������������������������������������������������� 243
Any Chance Functions Can Improve Performance?������������������������������������������������������������ 245
Functions and User-Defined Types�������������������������������������������������������������������������������������������� 246
User-Defined Data Types����������������������������������������������������������������������������������������������������� 246
Functions Returning Composite Types�������������������������������������������������������������������������������� 247
Using Composite Types with Nested Structure������������������������������������������������������������������������� 250
Functions and Type Dependencies�������������������������������������������������������������������������������������������� 255
Data Manipulation with Functions�������������������������������������������������������������������������������������������� 255
Functions and Security������������������������������������������������������������������������������������������������������������� 257
What About Business Logic?����������������������������������������������������������������������������������������������������� 258
Functions in OLAP Systems������������������������������������������������������������������������������������������������������ 259
Parameterizing�������������������������������������������������������������������������������������������������������������������� 260
No Explicit Dependency on Tables and Views���������������������������������������������������������������������� 261
Ability to Execute Dynamic SQL������������������������������������������������������������������������������������������� 261
Stored Procedures�������������������������������������������������������������������������������������������������������������������� 261
Functions with No Results��������������������������������������������������������������������������������������������������� 261
Functions and Stored Procedures��������������������������������������������������������������������������������������� 262
Transaction Management���������������������������������������������������������������������������������������������������� 262
Exception Processing���������������������������������������������������������������������������������������������������������� 263
Summary���������������������������������������������������������������������������������������������������������������������������������� 264

Chapter 13: Dynamic SQL������������������������������������������������������������������������������������� 265


What Is Dynamic SQL���������������������������������������������������������������������������������������������������������������� 265
Why Dynamic SQL Works Better in Postgres����������������������������������������������������������������������� 265
What About SQL Injection?�������������������������������������������������������������������������������������������������� 266
How to Use Dynamic SQL for an Optimal Execution Plan��������������������������������������������������������� 266
How to Use Dynamic SQL in OLAP Systems������������������������������������������������������������������������������ 274
Using Dynamic SQL for Flexibility��������������������������������������������������������������������������������������������� 277
Using Dynamic SQL to Aid the Optimizer���������������������������������������������������������������������������������� 286
FDWs and Dynamic SQL������������������������������������������������������������������������������������������������������������ 289
Summary���������������������������������������������������������������������������������������������������������������������������������� 290
ix
Table of Contents

Chapter 14: Avoiding the Pitfalls of Object-Relational Mapping�������������������������� 291


Why Application Developers Like NORM����������������������������������������������������������������������������������� 292
ORM vs. NORM�������������������������������������������������������������������������������������������������������������������������� 292
NORM Explained����������������������������������������������������������������������������������������������������������������������� 294
NORM in the Application Perspective���������������������������������������������������������������������������������������� 301
NORM from a Database Perspective����������������������������������������������������������������������������������������� 304
Mapping JSON to the Database������������������������������������������������������������������������������������������� 305
Generating Database Code�������������������������������������������������������������������������������������������������� 306
Getting Data from the Database������������������������������������������������������������������������������������������ 308
Modifying Data in the Database������������������������������������������������������������������������������������������ 311
Why Not Store JSON?!�������������������������������������������������������������������������������������������������������������� 314
Performance Gains������������������������������������������������������������������������������������������������������������������� 314
Working Together with Application Developers������������������������������������������������������������������������� 315
Summary���������������������������������������������������������������������������������������������������������������������������������� 315

Chapter 15: More Complex Filtering and Search�������������������������������������������������� 317


Full Text Search������������������������������������������������������������������������������������������������������������������������� 317
Multidimensional and Spatial Search��������������������������������������������������������������������������������������� 319
Generalized Index Types in PostgreSQL������������������������������������������������������������������������������������ 320
GIST Indexes������������������������������������������������������������������������������������������������������������������������ 320
Indexes for Full Text Search������������������������������������������������������������������������������������������������ 320
Indexing Very Large Tables�������������������������������������������������������������������������������������������������� 322
Indexing JSON and JSONB�������������������������������������������������������������������������������������������������������� 323
Summary���������������������������������������������������������������������������������������������������������������������������������� 326

Chapter 16: Ultimate Optimization Algorithm������������������������������������������������������� 327


Major Steps������������������������������������������������������������������������������������������������������������������������������� 327
Step-by-Step Guide������������������������������������������������������������������������������������������������������������������� 328
Step 1: Short or Long?��������������������������������������������������������������������������������������������������������� 328
Step 2: Short������������������������������������������������������������������������������������������������������������������������ 328

x
Table of Contents

Step 3: Long������������������������������������������������������������������������������������������������������������������������� 330


Step 4: Incremental Updates����������������������������������������������������������������������������������������������� 330
Step 5: Non-incremental Long Query���������������������������������������������������������������������������������� 330
But Wait—There Is More!��������������������������������������������������������������������������������������������������������� 331
Summary���������������������������������������������������������������������������������������������������������������������������������� 332

Chapter 17: Conclusion����������������������������������������������������������������������������������������� 333

Index��������������������������������������������������������������������������������������������������������������������� 335

xi
About the Authors
Henrietta Dombrovskaya is a database researcher and
developer with over 40 years of academic and industrial
experience. She holds a PhD in computer science from
the University of Saint Petersburg, Russia. At present, she
is a database architect at DRW Holdings, Chicago, Illinois.
She is an active member of the PostgreSQL community, a
frequent speaker at the PostgreSQL conference, and the
local organizer of the Chicago PostgreSQL User Group. Her
research interests are tightly coupled with practice and
are focused on developing efficient interactions between
applications and databases.

Boris Novikov’s experience includes leading postgraduate


research groups and advising dozens of PhD students
while partnering and collaborating with industrial clients.
His research interests are in the broad area of information
management and include design, development, and tuning
of databases, applications, and database management
systems (DBMSs). He also has interests in distributed
scalable systems for stream processing and analytics.

xiii
About the Authors

Anna Bailliekova is Senior Data Engineer at


UrbanFootprint, where she works on data platform tools
and cloud ops for geospatial applications. Previously,
she worked in data engineering at Zendesk and held a
variety of DBA and BI roles at Epic. Her writing can be
found in the newsletter Better Streets MKE. She received
her undergraduate degree with college honors in political
science and computer science from Knox College in
Galesburg, Illinois.

xiv
About the Technical Reviewer
Tom Kincaid is Vice President of Database Development at EnterpriseDB. Tom
has been developing, deploying, and supporting database systems and enterprise
software for over 25 years. Prior to joining EnterpriseDB, Tom was General Manager of
2ndQuadrant in North America where he oversaw all aspects of 2ndQuadrant’s dynamic
and growing business for Postgres products, training, support, and professional services.
He worked directly with companies from all industries and of all sizes helping them
successfully make Postgres part of their mission-critical operations.
Tom has overseen the design and delivery of Postgres training solutions as well as
the deployment of PostgreSQL both at Fortune 500 financial institutions and at military
facilities all over the world. Teams Tom has managed have delivered major features that
have become part of the PostgreSQL open source database.
Tom is also the founder and one of the organizers of the Boston PostgreSQL
User Group.

xv
Acknowledgments
It takes many people to bring a book into the world, most of whose names do not appear
on the cover. Firstly, we want to thank Jonathan Gennick, who came up with the idea
of this book and navigated it through the first edition. Without his initiative, this book
wouldn’t exist. We’re also grateful to the entire team at Apress who have supported this
endeavor across two editions.
The contributions of Tom Kincaid as the technical reviewer cannot be overstated.
His careful, thorough, and thoughtful feedback improved the content, organization,
and usability of the text. This book is more precise, more understandable, and more
comprehensive, thanks to Tom. We’re grateful that he returned for the second edition,
graciously taking another close read. Any remaining issues are, of course, our own
responsibility.
After the first edition of this book was released, we heard from many people
regarding issues in the postgres_air database, topics readers wished were covered,
and passages that could have been more clear. This second edition incorporates many
of their suggestions. We are grateful to everyone who took the time to read the book
closely and share their comments and suggestions with us. In particular, Hannu Krosing
provided thorough, detailed, and specific feedback on postgres_air, and Egor Rogov
provided many helpful suggestions for making the book more understandable and clear.

—Henrietta Dombrovskaya, Boris Novikov, Anna Bailliekova

Thank you to Jeff Czaplewski, Alyssa Ritchie, and Greg Nelson, who spent hours,
days, and weeks making No-ORM (NORM) work with Java. My time at EDB was a chance
to work with and learn from the best of the Postgres best. My colleagues at DRW—both
application and database administrator (DBA) teams—have given me new opportunities
to push the limits of Postgres.
—Henrietta Dombrovskaya

xvii
Acknowledgments

I’d like to thank Andy Civettini for teaching me how to write and talk about technical
topics in an accessible way and for years of academic and professional encouragement.
My colleagues at UrbanFootprint challenge and inspire me every day. Finally, John,
Nadia, and Kira Bailliekova have each supported me and sacrificed for the sake of this
book; I am endlessly grateful to them.

—Anna Bailliekova

xviii
Introduction
“Optimization” is a broad enough term to encompass performance tuning, personal
improvement, and marketing via social engine and invariably evinces high hopes and
expectations from readers. As such, it is prudent to begin not by introducing what
is covered, but rather, why this book exists and what will not be covered, to avoid
disappointing readers who approach it with inappropriate expectations. Then, we
proceed with what this book is about, the target audience, what is covered, and how to
get the most use out of it.

Why We Wrote This Book


Like many authors, we wrote this book because we felt we could not not write it.
We are educators and practitioners; as such, we see both how and what computer
science students are taught in class and what knowledge they lack when they enter the
workforce. We do not like what we see and hope this book will help bridge this gap.
When learning about data management, most students never see a real production
database, and even more alarming, many of their professors never see one, either. While
lack of exposure to real-life systems affects all computer science students, the education
of future database developers and database administrators (DBAs) suffers the most.
Using a small training database, students can learn how to write syntactically correct
SQL and perhaps even write a SELECT statement that accurately retrieves desired data.
However, learning to write performant queries requires a production-sized dataset.
Moreover, it might not be evident that performance might present a problem if a student
is working with a dataset that can easily fit into the computer’s main memory and return
a result in milliseconds regardless of the complexity of the query.
In addition to lacking exposure to realistic datasets, students often don’t use DBMSs
that are widely used in industry. While the preceding statement is true in relation
to many DBMSs, in the case of PostgreSQL, it is even more frustrating. PostgreSQL
originated in an academic environment and is maintained as an open source project,
making it an ideal database for teaching relational theory and demonstrating database
internals. However, so far, few academic institutions have adopted PostgreSQL for their
educational needs.
xix
Introduction

As PostgreSQL is rapidly developing and becoming a more powerful tool, more


and more businesses are choosing it over proprietary DBMSs, in part to reduce
costs. More and more IT managers are looking for employees who are familiar with
PostgreSQL. More and more potential candidates learn to use PostgreSQL on their own
and miss opportunities to get the most out of it.
We hope that this book will help all interested parties: candidates, hiring managers,
database developers, and organizations that are switching to PostgreSQL for their
data needs.

What Won’t Be Covered


Often, when users start to complain that “everything is slow” or nightly backups finish
in broad daylight and everyone seems to be saying that “the database needs to be
optimized,” conversations are almost exclusively focused on database configuration
parameters and occasionally on underlying Linux parameters. It is often assumed that as
soon as the correct values for parameters are chosen and the database instance has been
restarted, all the world’s problems will be solved.
Countless times, we have worked with customers expecting magical incantations and
cheat codes. Countless times, these customers have expressed a deep disappointment
when the “wizards” to whom they have appealed suggest looking for the queries that
are executed most often or check for missing indexes. After listening politely to all our
suggestions, they kept asking: So can you suggest any other parameter changes?
Indeed, it is tempting to be able to solve every problem at once. That temptation
leads to the popular belief that there is a sort of dark magic and secret codes, a button
hidden under a desk somewhere that makes the database run faster.
Since we are aware of these misconceptions, we want to be transparent from the
very beginning. The following is the list of topics that are often discussed in books about
optimization but will not be covered in this book and why:

• Server optimization – With the mass migration to various cloud


environments and existing organizational structures, database
developers are unlikely to have a say in how servers are configured.

xx
Introduction

• PostgreSQL configuration parameters – In this second edition of the


book, we do cover this topic. However, it comprises a relatively small
portion of the book, as their impact on performance is overrated, as
we will demonstrate, and usually, database developers do not have
the necessary privileges to alter them (with a few exceptions).

• Distributed systems – We do not have enough industrial experience


with them.

• Transactions – Their impact on performance is very limited (although


we will cover some cases when they can have a major impact).

• New and cool features – These change with every new release, and
our goal is to cover the fundamentals.

• Magic, rituals, cheat codes, etc. – We are not proficient in these


approaches to optimization.

There are plenty of books available that cover all of the topics listed previously,
except the last, but this book is not one of them. Instead, we focus on everyday
challenges database developers face: when that one application page keeps timing out,
when a customer is kicked out of the application just before the “Contract Signed” page,
when the CEO dashboard is showing an hourglass instead of yesterday’s product KPI, or
when procuring more hardware is not an option.
Everything we are presenting in this book has been tested and implemented in an
industrial environment, and though it may look like magic, we will explain any query
performance improvement or lack thereof.

Target Audience
Most of the time, a book about optimization is viewed as a book for DBAs. Since our goal
is to prove that optimization is more than just building indexes, we hope that this book
will be beneficial for a broader audience.
This book is for IT professionals working in PostgreSQL who want to develop
performant and scalable applications. It is for anyone whose job title contains the
words “database developer” or “database administrator” or who is a backend developer
charged with programming database calls. It is also useful to system architects involved
in the overall design of application systems running against a PostgreSQL database.

xxi
Introduction

What about report writers and business intelligence specialists? Unfortunately, large
analytical reports are most often thought of as being slow by definition. However, if a
report is written without considering how it will perform, the execution time might end
up being not just minutes or hours, but years! For most analytical reports, execution time
can be significantly reduced by using simple techniques covered in this book.

What Readers Will Learn


In this book, the readers will learn how to

• Identify optimization goals in OLTP (Online Transaction Processing)


and OLAP (Online Analytical Processing) systems

• Read and understand PostgreSQL execution plans

• Identify indexes that will improve query performance

• Optimize full table scans

• Distinguish between long queries and short queries

• Choose the right optimization technique for each query type

• Avoid the pitfalls of ORM frameworks

At the end of the book, we present the Ultimate Optimization Algorithm,


which guides a database developer through the process of producing the most
performant query.

The Postgres Air Database


Throughout this book, examples are built on one of the databases of a virtual airline
company called Postgres Air. This company connects over 600 virtual destinations
worldwide, offers about 32,000 direct virtual flights weekly, and has over 100,000 virtual
members in its frequent flyer program and many more passengers every week. The
company fleet consists of virtual aircraft.
Please note that all data provided in this database is fictional and provided for
illustrative purposes only. Although some data appears very realistic (especially
descriptions of airports and aircraft), they cannot be used as sources of information about
real airports or aircraft. All phone numbers, email addresses, and names are generated.

xxii
Introduction

To install the training database on your local system, please refer to the GitHub repo:
github.com/Hettie-d/postgres_air.
The README.md file contains the link to the data directory and detailed installation
instructions.
In addition, after you restore the data, you will need to run the script in Listing 1 to
create several indexes.

Listing 1. Initial set of indexes

SET search_path TO postgres_air;


CREATE INDEX flight_departure_airport ON flight(departure_airport);
CREATE INDEX flight_scheduled_departure ON flight  (scheduled_departure);
CREATE INDEX flight_update_ts ON flight  (update_ts);
CREATE INDEX booking_leg_booking_id ON booking_leg  (booking_id);
CREATE INDEX booking_leg_update_ts ON booking_leg  (update_ts);
CREATE INDEX account_last_name ON account (last_name);

We will use this database schema to illustrate the concepts and methods that are
covered in this book. You can also use this schema to practice optimization techniques.
This schema contains data that might be stored in an airline booking system. We
assume that you have booked a flight online, at least once, so the data structure should
be easily understood. Of course, the structure of this database is much simpler than the
structure of any real database of this kind.
Anyone who books a flight needs to create an account, which stores login
information, first and last names, and contact information. We also store data about
frequent flyers, which might or might not be attached to an account. A person who
makes a booking can book for several passengers, who might or might not have their
accounts in the system. Each booking may include several flights (legs). Before the flight,
each traveler is issued a boarding pass with a seat number.
The Entity-Relationship (ER) diagram for this database is presented in Figure 1.

• airport stores information about airports and contains the airport’s


three-character (IATA) code, name, city, geographical location, and
time zone.

xxiii
Introduction

• flight stores information about flights between airports. For each


flight, the table stores a flight number, arrival and departure airports,
scheduled and actual arrival and departure times, aircraft code, and
flight status.

• account stores login credentials, the account holder’s first and


last names, and possibly a reference to a frequent flyer program
membership; each account may potentially have multiple phone
numbers, which are stored in the phone table.

• frequent_flyer stores information about membership in the frequent


flyer program.

• booking contains information about booked trips; each trip may have
several booking legs and several passengers.

• booking_leg stores individual legs of bookings.

• passenger stores information about passengers, linked to each


booking. Note that a passenger ID is unique to a single booking;
for any other booking, the same person will have a different
passenger ID.

• aircraft provides the aircraft’s description, and the seat table stores
seat maps for each of the aircraft types.

• Finally, the boarding_pass table stores information about issued


boarding passes.

xxiv
Introduction

Figure 1. ER diagram of the booking schema

xxv
CHAPTER

The Key to
Digital
Transformation
Success
In the age of digitization, businesses face a critical imperative: to adapt and
embrace innovation or risk being left behind in a rapidly evolving world.
The concept of creative destruction, which is the process where innovation
and technology advancements are reshaping industries and business models,
is the driving force behind digital transformations. In this chapter, you’ll
explore what digital transformation is and the state of digital transformation
programs where unfortunately there is a high failure rate. Learn about the
challenges of digital transformation and the key role strategic alignment plays
in its success. Discover how process serves as a common language, aligning
organizations vertically and horizontally, and explore the Process Inventory

© Michael Schank 2023


M. Schank, Digital Transformation Success,
https://doi.org/10.1007/978-1-4842-9816-9_1
4 Chapter 1 | The Key to Digital Transformation Success

framework’s role in identifying, managing, and aligning processes. By the end


of this chapter, you’ll be equipped with an understanding of how Process
Inventory not only enables digital transformation’s success but also has the
power to transform how the organization integrates technical capabilities,
leads to operational excellence, streamlines the management of change, and
enhances risk management capabilities.

Nokia’s Mobile Phone Business


Founded in 1865 in Finland, Nokia initially focused on various industries,
including pulp and paper, rubber, and electronics [1]. In the 1990s, Nokia
made a strategic decision to shift its focus toward mobile phones. The
company overtook Motorola in October 1998 to become the best-selling
mobile phone brand in the world. Their net operating profits went from $1
billion in 1995 to almost $4 billion by 1999. A major reason for their success
was catering to a youthful consumer market and fashion-oriented consumers
with colorful and replaceable back covers. They were also innovators,
introducing the first camera phone to the market in 2002 and pioneering
mobile gaming with a preloaded version of Snake.
In 2007, Apple introduced the iPhone. By Q4 2007, half of all smartphones
sold in the world were Nokias, while the iPhone market share was 5% [2].
The iPhone revolutionized the mobile industry with its touchscreen interface
and robust app ecosystem. Nokia underestimated the impact of smartphones
and the changing preferences of consumers. They continued to rely on their
traditional strengths, such as hardware design and the Symbian operating
system, while underestimating the importance of software and user
experience. The Symbian platform quickly became outdated and posed
difficulties for developers after the advent of iOS and Android. Nokia’s market
share dropped by 90%, and in 2013, their mobile phone business was acquired
by Microsoft.
A study named “Distributed Attention and Shared Emotions in the Innovation
Process: How Nokia Lost the Smartphone Battle” [3] was conducted,
interviewing 76 of Nokia’s top and middle managers, engineers, and external
experts to determine the root causes. The study found that the downfall can
be attributed to a lack of organizational alignment. It highlighted several
factors, including a culture of fear, intimidated middle managers, a lack of
technical competence among top managers, and a short-term focus on market
demands. The internal politics and shared fear created a climate of mistrust
that hindered innovation.
Digital Transformation Success 5

Creative Destruction in the Age of Digitization


The concept of creative destruction, introduced by Austrian American
economist Joseph Schumpeter in 1942 [4], has impacted various companies,
such as Nokia, Blockbuster Video, Kodak, Blackberry, and Toys ‘R’ Us to name
a few. Creative destruction describes the process whereby innovation and
technological advancements disrupt established industries and business models.
According to Schumpeter’s theory, it is inherent in human nature to be
creative and strive for an improved standard of living. Additionally, the
pursuit of profit incentives drives constant innovation and technological
advancements [5]. In a competitive environment, producers generate ideas
that advance technologies, redesign existing products and processes, and
introduce new products. This competition results in improved products at
lower costs, ultimately benefiting consumers.
This continuous process of innovation and economic competition contributes
to overall economic growth and enhances the standard of living for consumers.
However, it also poses a significant risk to incumbent organizations that fail to
adapt as they can be displaced or even eliminated by more innovative
competitors. This is driving the urgency in many organizations to invest in
their own digital transformation program.

Digital Transformation Defined


Digital transformation is the application of digital capabilities to processes,
products, and assets to improve efficiency, enhance customer value, manage
risk, and uncover new monetization opportunities [6]. There are many digital
capabilities driving this, such as artificial intelligence, cloud computing, Internet
of Things (IoT), big data analytics, blockchain, and more. This goes beyond
simply acquiring these new technologies and teaching your staff to use them.
Digital transformation must be framed in a business context, which is why the
preceding definition includes “uncover new monetization opportunities.”
Monetization opportunities may mean new product revenue streams,
deepening customer relationships, expanding to new ones, or reducing the
cost of doing business. The implications of maximizing these capabilities for an
organization can be far-reaching and may fundamentally change core
business models.
The essence of digital transformation lies in becoming a customer-centric,
data-driven, and agile organization. It entails ensuring that key decisions,
actions, and processes are guided by data-driven insights rather than just
human intuition [7].
6 Chapter 1 | The Key to Digital Transformation Success

The challenge, and opportunity, is that the capabilities of these technologies


are advancing at a rapid rate, making it hard to accurately predict how they
will impact businesses in the next five years or beyond. The external
environment must also be factored in, such as changes to the competitive
landscape, customer preferences, globalization, and regulatory environment.
This means that digital transformation must be viewed as a continuous
journey, requiring a strong digital strategy and adaptive execution to respond
to changes through iterations and continuous learning. A crucial factor in
being adaptive is achieving operational excellence, which involves optimizing
and maximizing efficiency across all resources leveraged to operate your
business. By embracing operational excellence, organizations ensure their
flexibility and responsiveness in the face of advancing digital capabilities and
evolving external environments.

State of Digital Transformation


According to a study, digital companies achieve 1.8 times higher [8] earnings
growth. Technology advancements mean that digital companies have greater
productivity improvements, better customer experiences, and stronger innovation.
The global digital transformation market is projected to grow from $695.5 billion
in 2023 to over $3.14 trillion by 2030, at a compound annual growth rate (CAGR)
of 24.1% during this period [9]. About 89% [10] of enterprises are planning to
adopt or have already adopted a digital business strategy.
Shockingly, 70% of such initiatives have been found to fail to reach their goals
[8]. This represents a massive investment with a very high failure rate. The
implication is more than just lost investment; it also means frustrated
stakeholders, lost ground to competitors, unsatisfied customers, and in some
cases, costs such as high regulatory penalties.

Why Digital Transformations Fail


According to McKinsey [11], the reasons transformations fail are as follows:
• Lack of Aspiration: The CEO fails to set a sufficiently
high aspiration. People throughout the organization do
not buy in, and they lack the motivation to invest extra
energy in making the change happen.
• Lack of a Shared Vision: During the early stages of the
transformation, the CEO does not build conviction
within the team about the importance of the change or
craft a change narrative that convinces people they need
to drive the transformation.
Digital Transformation Success 7

• Lack of Engagement: People throughout the


organization do not buy in, resulting in a lack of willingness
to invest the extra energy required to drive the
transformation.
• Low Investment in Capability Building: The
leadership team neglects to address skill gaps within the
organization or fails to free up key resources from their
other day-to-day responsibilities.
• Insufficient Structure of the Transformation
Team: The organization fails to establish the right change
management structure and cadence for leadership and
transformation management oversight.
For many medium and large organizations, these can be challenging hurdles to
overcome due to their complexity. With organizations that have tens or
hundreds of thousands of employees, it becomes an immense challenge to align
and coordinate all those resources, especially when the transformation goals
are ambitious. However, complexity alone cannot be solely blamed as there are
many digitally successful organizations that effectively manage complexity.
The underlying root cause of these challenges is a lack of strategic
alignment. Strategic alignment means that all elements of a business,
including market strategy and the way the company is organized, are arranged
in such a way as to best support the fulfillment of its long-term purpose [12].
This means aligning the purpose, vision, and mission statements, which
articulate why the organization exists and the future they are driving toward,
with strategy, which is how the business will achieve that purpose. Strategy
defines which products and services to offer, which markets to serve, and in
this context, how they will adopt digital technology to further support the
purpose of the organization. Strategy needs to be aligned with the capabilities
of the organization, which are all resources including people, processes,
technology, data, vendors, etc. that support the organization. An example is
an organization that is looking to achieve superior customer service must
translate that into a high level of excellence when frontline staff are engaging
with customers directly.
There are two important aspects of strategic alignment: vertical alignment
and horizontal alignment. Vertical alignment refers to aligning strategies, goals,
and performance metrics hierarchically from the CEO through middle
management down to the single contributors. Horizontal alignment means
that business units and functional areas such as technology, finance, and risk
collaborate strongly across these areas and avoid siloed operating models,
which bring a great number of inefficiencies. Achieving strategic alignment
facilitates unification across resources which not only enables an organization
to meet their digital transformation goals but enables organizational agility.
8 Chapter 1 | The Key to Digital Transformation Success

But how do organizations achieve strategic alignment? After all, this is not a
new concept, yet it exists in so few organizations. I believe the answer lies in
language. Everyone in these organizations is focused on their responsibilities,
and they develop their perspectives based on their work. This often results in
lower-level contributors not fully understanding the strategic messages
coming from the CEO. As a result, they may fail to invest their energies in
contributing to the transformational ambitions of leadership. When a person
from a business unit conveys requirements to a technology professional, they
may struggle to accurately communicate what they are looking for, leading to
poor requirements, or delivered software that misses the mark. This lack of
understanding and effective collaboration contributes to the formation of
redundancies within organizations, where different functional units create
processes that others already perform.
A common language should create a shared understanding vertically and
horizontally. It would align objectives, facilitate better communications, bridge
cultural differences, and enable conflict resolution. What are the requirements
of this common language? First, since it must support the purpose of the
organization, it has to be oriented in the language of the business. This
eliminates, for instance, technical terminology, you wouldn’t want to state as
a strategy that you’re going to implement artificial intelligence unless you
could convey how it supports your customers, generates revenues, or furthers
the mission. But it does have to be a bridge to cross-functional topics such as
technology, risk, data, and regulators. Lastly, it needs to connect a high-level
view that senior leadership would understand to a low-level view that a single
contributor would understand.

Process Is the Common Language


The only candidate that meets those requirements is process. I’ll illustrate this
in a story that highlights how organizations evolve with process at its core.
Let’s say that you are talking to a couple of friends about starting a business.
That conversation begins with the actions or processes that must occur. The
conversation would go something like this: “We can create great designs,
print them on t-shirts, and sell them at concerts.” The purpose of the company
will be to make money or get a message out, but in that statement, the
business processes have been identified:
• Create designs
• Print design on T-shirts
• Sell at concerts
Digital Transformation Success 9

Let’s say that this company has success. Then they realize that they will have
to file taxes, but none of them have the skill set or the time, so they hire
someone for that purpose and have now added the process of
• Calculate tax liabilities
• File taxes
• Pay tax liabilities
This means that they’ve now expanded the organization chart to support the
need to do taxes. Then they purchase tax software for them which is the
beginning of their technology portfolio. The business is doing so well that you
seek out investors, but investors will want financial reports that are based on
solid accounting standards, which leads to them hire an accountant to perform
the following processes:
• Close books
• Create financial report
This accountant will require accounting software. Now they’ve started a
finance functional unit which has tax and accounting processes, an organization
chart, and a technology portfolio.
I can go on, but what you can see is that the needs of the organization to
support its purpose drive the need for processes. Process is core to
organizational capabilities as people are hired, technology is purchased or
built, and risk is incurred, all to support the processes of the business. Plus, a
hierarchy of processes evolves as processes get more complex and lower-
level resources are hired to perform more detailed tasks.

The Process Inventory Framework


The Process Inventory is a framework for capturing every process within an
organization and a methodology for managing this information sustainably
over time. One of the guiding principles for Process Inventory is that it must
be a complete representation of processes for the organization in scope. To
accomplish this, interviews must be conducted following the organizational
chart since that represents a complete inventory of people in the organization.
These interviews start at the top of the organizational chart, working down
from business units or functional levels to the team or individual contributor
level. Stakeholders are requested to provide formal attestations to ensure
completeness and accuracy in the inventory, including any process inventories
collected by their teams.
10 Chapter 1 | The Key to Digital Transformation Success

Starting from the top of the organizational chart enables vertical alignment,
allowing for a direct trace of process ownership from the CEO to individual
contributors at all levels.
Organizations often have multiple sources of information that describe
various aspects of their operations, such as application repositories, risk
repositories, product, and channel repositories, and more. However, this data
is usually managed in silos and lacks concrete associations across topics,
hindering horizontal alignment.
The Process Inventory framework establishes a taxonomy that classifies all
processes executed to support the organization’s purpose. This taxonomy
serves as an index for aligning different aspects of the organization through a
single business-oriented language. A modeling team can extract information
from these repositories and create associations, at the process name level or
through creating process models, where operational information intersects
with processes.
This achieves horizontal alignment in three ways. Firstly, it enables functional
teams to precisely identify how their concepts intersect with processes. For
example, by examining the intersection of applications in an application
repository with processes, it becomes possible to determine which applications
support specific processes and even drill down to the level of identifying which
APIs within those applications support specific steps in a process. This is
valuable in identifying the scope and requirements for change management
initiatives. Secondly, it provides transparency to all stakeholders regarding the
activities of each business unit and functional team. This transparency helps
break down silos and facilitates better coordination. Lastly, it promotes a
culture of accountability by identifying points of ownership and fostering
strong collaboration across organizational units where necessary.
This framework is analogous to Google Maps, where you can view Earth from
space, but then you can zoom in to see details of your house and the signs on
your street. Google’s initiative called Ground Truth [13] marries numerous
data sets about our world, such as traffic patterns, restaurant ratings, and
street view images to physical locations. This has revolutionized not only
navigation but also how we interact in the world and how advertisers reach us.

The Digital Transformation Journey


In a digital transformation, this common language enables the leadership team
to articulate their aspirations for a digital future, and the transformation
teams can identify specific processes that need to change or processes to be
added. The shared vision can be cascaded throughout the organization, clearly
defining responsibilities and performance metrics to drive the transformation.
This culture of accountability will foster engagement as everyone will
Digital Transformation Success 11

understand how their work directly contributes to the bigger picture.


Essentially, this enables solutions to the typical failures encountered in digital
transformations.
In this book, I will extensively detail the constructs of this framework, including
the operating model and the methods to create and maintain the process
inventory and associated metadata sourced from various repositories.
I will cover the method of defining a digital strategy and how to set up the
transformation program for success. The core of this process involves defining
the digital transformation strategy in the context of how it supports the
organization’s purpose and aligns with operational capabilities. This
encompasses defining the business areas and use cases that need improvement,
along with the ways of working. I provide details on how the Process Inventory
framework can transform these use cases.
A significant aspect of adapting to the digital age is integrating new technology
capabilities. Technology is typically one of the largest investments an
organization makes and can be a source of pain, especially when the technical
architecture becomes rigid. I will detail how this framework can lead to much
better IT architecture documentation, creating alignment between IT assets
and the processes they serve. This visibility can help rationalize complexity by
eliminating redundant systems and increasing reuse, which is key to flexibility
and efficiency. Additionally, I will demonstrate how this directly supports the
design and implementation of digital technologies such as intelligent process
automation, the adoption of artificial intelligence and machine learning at
scale, and how to build a business-led modular architecture design, which is
crucial for an agile architecture.
Operational excellence is achieved with this level of transparency at your
fingertips. You can precisely identify all the resources that support a business
or process area, enabling the identification of inefficiencies or opportunities
to streamline operations. Continuous improvement will be promoted by a
framework that enables better monitoring of business processes and the
collection of key performance indicators.
Workforces will be transformed by having greater training and development
programs to equip staff members with skills and knowledge, not only in their
domain but also with a broader understanding. This will foster a culture of
innovation by unlocking knowledge that was held by so few and encouraging
everyone to identify better ways of doing things.
Change management is a significant challenge for many organizations,
particularly in large change efforts. This framework has the potential to greatly
transform the entire process. The alignment of strategic priorities can be
mapped to the impacted processes. This clarity brings more objectivity to the
change portfolio investment process, resulting in stronger effectiveness in the
allocation of discretionary funds to projects with the greatest strategic needs.
12 Chapter 1 | The Key to Digital Transformation Success

Project scope can be stated in terms of the business processes involved. This
approach ensures certainty of impacts across all resources leveraged by the
business process, including people, processes, controls, data, and technology.
The result is enhanced cost and timeline estimates and better resource
alignment.
The change process would undergo significant changes by anchoring it to this
framework. Framing the contents of SDLC, Agile, and organizational change
management deliverables, such as business requirements, agile user stories,
technology designs, control designs, testing scripts, and user training, using
the Process Inventory taxonomy as the structure will increase coordination
across teams and enhance traceability for those responsible for project
management in these efforts. This also has the benefit of generating better
change status reports by communicating the progress and readiness of
individual processes as the numerator for percent complete reporting.
The efficiencies provided by this framework will enable faster change
implementation with reduced investment needs, thereby freeing up resources
to concentrate on enhancing customer experience and driving product
innovations.
Risk management is strengthened by giving risk professionals a
comprehensive inventory of processes, which will enable them to perform
better risk assessments and create a more accurate inventory of risks across
all risk types. This allows them, in conjunction with their business partners, to
prioritize and design effective controls and ensure regulatory compliance. The
risk operating model will be empowered across all three lines of defense for
stronger effectiveness and coordination such as arming internal audit with
information needed to effectively test controls. This will give senior leaders
and boards confidence that they are getting accurate risk information to make
their strategic decisions.

Framework Implementation Considerations


This may seem overwhelming, but I assure you it’s not. I have dedicated 12
years of my career to developing and testing this framework in various
scenarios. I have successfully implemented it at multiple large financial
institutions, tailoring it to their specific needs. I have refined the methods to
be efficient with limited resources and to ensure the quality of the models,
which forms the basis for all the benefits I have presented.
The framework is designed to be incremental and scalable according to your
requirements as defined by your transformation strategy. It can be applied at
the enterprise level or selectively to specific business units or functions. You
have the flexibility to implement only the use cases that are relevant to your
organization.
Digital Transformation Success 13

Indeed, adopting this framework requires an investment of time and resources.


However, it’s important to recognize that organizations pay a price for
misalignment. You have a choice: invest upfront to avoid inefficiencies, costly
penalties, or losing market share to more digitally adept competitors, or bear
the consequences later.

Key Takeaways
• Creative destruction is driving the digital age through
innovation and technological advancements which are
reshaping business models and industries.
• Digital transformation is the application of digital
capabilities to processes, products, and assets to improve
efficiency, enhance customer value, manage risk, and
uncover new monetization opportunities.
• High failure rate as 70% of such initiatives fail to reach
their goals, which means lost investment, frustrated
stakeholders, lost ground to competitors, unsatisfied
customers, and potentially high regulatory penalties.
• Lack of strategic alignment is the underlying root
cause of failure which hinders collaboration and
organizational focus toward strategic goals.
• A common language is needed to facilitate alignment.
Process, as captured by the Process Inventory framework,
provides the common language.
• Process Inventory enables digital transformation
success and transforms how the organization operates
which leads to operational excellence.
In the next chapter, we will describe the Process Inventory framework, which
includes models, modeling characteristics, metadata, and conceptual
architecture.
CHAPTER

Overview of
the Process
Inventory
Framework
In this chapter, you will explore the components of the Process Inventory
framework. Delve into the significance of this framework in establishing an
ontology to organize organizational knowledge. Understand the methods for
constructing and maintaining a Process Inventory, and explore the conceptual
architecture used to integrate metadata from diverse authoritative sources.
Additionally, you’ll gain insights into related models, such as process models,
customer journeys, and value streams. The framework, with all its associated
components, is critical for structuring and utilizing knowledge effectively
within an organization to deliver transformational value.

© Michael Schank 2023


M. Schank, Digital Transformation Success,
https://doi.org/10.1007/978-1-4842-9816-9_2
16 Chapter 2 | Overview of the Process Inventory Framework

 he Origins of the Process


T
Inventory Framework
I started my career in 1996 at Andersen Consulting, which later became
Accenture. My college degree had a focus on information systems, so I began
in a technology practice. My first engagement was with a large bank in
Charlotte that was developing a direct banking platform, an emerging concept
at that time.
I initially joined a production support team where we handled issues with
middleware code. Middleware is an application pattern for distributing
messages to appropriate platforms. My role involved triaging issues, identifying
root causes within the application code, and developing and testing fixes.
During the first 15 years of my career, I primarily focused on technology. I
worked as a C++ and Java developer and a solution architect and led large
teams in software delivery.
I transitioned from retail banking to commercial banking without having a
strong understanding of these businesses. While I knew about retail banks
since I was a customer with a checking account, commercial banking was
completely foreign to me. My focus was on delivering quality software on time
and supporting production to minimize customer impact. Most of my
interactions were with other technologists; I was curious about what the
business did, but I didn’t have a clear path to explore it.
In 2011, I joined EY, which introduced me to a new world. At that time, EY
had limited software development engagement, and their clients were typically
senior leaders across various business areas such as risk, technology, and
more. The work involved helping these leaders develop solutions to enhance
their organizations’ effectiveness. It was a refreshing shift from my technology-
centric mindset.
One of my early engagements at EY was with a large retail bank. They had
surplus budgeted funds that needed to be spent; otherwise, the funds would
be lost the following year. One of their requirements was to build a business
capability model for their retail banking business. While not an exhaustive
exercise, we interviewed key individuals in their businesses and created a
model with three levels of depth. It was a moment of epiphany for me. The
entire business’s activities were encapsulated in a single model, exactly what I
had been seeking during my technology days to understand what the business
did. I was enthused about the potential of this concept to bring diverse
perspectives together and what this could mean for delivery on a wide range
of topics. From that point on, I positioned myself as a business architect,
eager to delve deeper into this concept, and using this branding helped me
connect with clients implementing similar approaches.
Digital Transformation Success 17

BUSINESS ARCHITECTURE

Business architecture emerged as a concept in the 1980s. British management


consultant Edwin E. Tozier was one of the first to mention the concept in an article
he wrote titled “Developing Strategies for Management Information Systems” [1].
In this article, he distinguished between information architecture and business
architecture, stating his theory that each business function may be supported by one
or more information systems and that information systems need to be adaptable to
organizational strategies.
Business architecture has evolved significantly since then. Several standard-setting
organizations such as TOGAF (The Open Group Architecture Framework), OMG (Object
Management Group), the Business Architecture Guild, and others have been advancing
the concepts and practices, although a common definition remains elusive.
The definition that has resonated the most with me is from OMG, which states
that business architecture is “a blueprint of the enterprise that provides a common
understanding of the organization and is used to align strategic objectives and tactical
demands” [1]. This definition always made intuitive sense to me as changes to a
physical building wouldn’t be made without such a blueprint, but many organizations
will spend significant amounts of money without any similar concept.
The core deliverable in business architecture is the business capability model. A
business capability model represents the required capabilities that an organization
must deliver for its purpose. They are largely independent of specific organizational
structures, reporting relationships, political agendas, cultural aspects of individual
business leaders, current initiatives, and projects [2]. Business capability models have
been used for various purposes, such as strategic planning, where a heatmap may
be created to highlight the capabilities in most need of improvement and investment.
They are also used to map assets, such as IT systems, which enables better
communication with teams involved in implementing strategies. Generally, however,
business architecture and business capability models do not model specific processes
as their aim is to be high level and agnostic to organizational structure.

Shortly after that, I was brought in to assist a client in the mortgage industry.
As a mitigation strategy following the 2008 financial crisis, they had decided
to outsource several critical business functions to a third-party provider.
However, the project was in deep trouble, with status reports showing red on
most measures despite a significant investment made in terms of dollars and
resources. The requirements team lacked structure and was not making
progress toward delivering a complete and high-quality product. Additionally,
the business architecture team they had in place was struggling to add value.
Recognizing the need for a strategic pause to recalibrate the approach, the
senior client stakeholders gave us a three-week timeframe.
18 Chapter 2 | Overview of the Process Inventory Framework

The business architecture team was implementing an approach I had not


encountered before. They utilized a sophisticated modeling platform and
connected their business capability model to detailed process models. During
the pause, I collaborated with the leadership of the business architecture team
to develop a comprehensive plan. This plan included a stakeholder engagement
model, a rigorous approach to work product creation, developing standards, a
quality assurance process, and even an estimating model for more precise
delivery date projections. When the work resumed, we essentially created a
Process Inventory, although that was not the name used at that time. We
conducted interviews with functional areas to capture every process they
performed and then created process models to detail how those processes
were executed. These inventories and process models underwent a stringent
quality assurance review to ensure compliance with standards before the
identified process owner attested to their accuracy. This structure enabled the
requirements team to measure their progress toward completion, gain a
detailed understanding of the process operations, and obtain sign-off on final
requirements from named process owners. By establishing this factory-like
model with clear activity sequences and accountabilities, the project transformed
from red to bright green. This experience taught me valuable lessons, particularly
the anchoring power of this concept in large-scale transformation programs. I
also recognized the importance of connecting business processes, maintaining
high standards, and prioritizing quality as critical success factors.
From that point on, I sought to refine this methodology and test it in diverse
scenarios, including an insurance spin-off, a bank merger, strategic architecture
design for a wealth management firm, business continuity planning for a capital
markets firm, and risk management for a global financial utility.
My focus shifted to selling this concept within the financial services industry,
which put me in front of numerous clients with complex problems to solve.
While many of these clients acknowledged the significance of process within
their solutions, they struggled to articulate how it would play a role. For
others, I seamlessly integrated it into proposals, knowing it would be beneficial.
Regardless, I achieved success in selling the approach as its intuitive appeal
resonated with everyone.
This chapter delves into the framework’s details, encompassing various
models and their interconnectedness, providing a solid foundation for
transformation initiatives.

The Process Inventory Framework


In Chapter 1, I described how Process Inventory is a common language that
facilitates strategic alignment, which is critical for transforming an organization
into the digital age and operating with excellence. This is certainly true, but
I’d like to go a bit deeper to describe what it represents.
Digital Transformation Success 19

The Process Inventory framework represents an ontology for an organization.


The word “ontology” gained usage with ancient philosophers like Plato and
Aristotle. “Ontology” comes from the Greek words “ontos,” meaning “being,”
and “logos,” meaning “study” or “discourse” [3]. As they defined the term,
ontology was the study of what exists and how the things that exist relate to
each other, providing answers to fundamental questions about existence.
In modern times, ontologies are used in many fields such as information
sciences, Semantic Web, bioinformatics, healthcare, natural language
processing, artificial intelligence, and more. Today, the concept is defined as a
formal representation of knowledge that encompasses a set of concepts, their
properties, and the relationships between them within a specific domain. It
provides a shared understanding of the structure and semantics of a domain,
enabling effective knowledge organization, reasoning, and information
integration [4]. To put this in layman’s terms for an organization, it maps out
how all the resources and concepts intersect to support the mission of the
organization.

Purpose & Strategy


Vision Customers
Mission
Product & Channels Customer Persona
Goals
Customer Journeys
Objectives

Product Category Channels


Tactics Moments of Truth

Product Subcategory
Interactions
Product

Process Risk Management


Enterprise Architecture
External
Events
System Interfaces Systems Control
Functions Risk
Regulatory
Obligation Laws,
Platform / Service Regulations

Vendor Contract Data


Element
Vendor
Level N Data Enterprise Data
Entity
Vendor Management Data
Level 2
Subject
Area
Organizational Level 1
Structure

Figure 2-1. Organizational Ontology


Random documents with unrelated
content Scribd suggests to you:
officer came and accomplished this with military ceremony; but we
were still unable to proceed, for a whole drove of asses and mules,
laden with fruits, vegetables, &c. had stationed themselves in the
pass on the other side, and began to enter amidst the smacking of
whips, and hallooing of muleteers; this occupied at least ten minutes.

Shortly afterward we took up a man who had fought in the battle of


Trafalgar, but was now a traiteur at Nice, and had been into the
country to purchase grapes, in order to manufacture his own wine:
he seemed pleased on discovering that I had served in the British
navy, of which he spoke very highly.

We now arrived on the banks of the Var, which separates the


kingdoms of France and Sardinia, and, with little interruption from the
custom-house officers, immediately crossed the frontiers.

We here received the addition to our party, of two very genteel


ladies and a gentleman, who proved for the remainder of the journey,
most agreeable companions; I was so much interested in their
conversation, that, almost without being sensible of the progress, we
arrived at the Hotel des Etranger, at Nice.

I am unwilling, finally, to take my leave of France, without


expressing an opinion of the character of a people, with whom I had
been so long resident; the unfavourable circumstances, however,
under which only I could contemplate them, make me diffident in
advancing my opinion, as I am fully conscious of an inability to give
the picture that energy and justice of colouring which it requires. I
shall, therefore, confine myself to a few general remarks.

There is something highly fascinating in the exterior, manners, and


converse of a Frenchman; courteous in his behaviour, he evinces a
strong desire to please and be pleased; but although he manifests
the speciousness of ardent friendship, his heart is not the soil, in
which this quality is capable of taking a firm and unshaken root; as
soon as the source, from which it has emanated, and been
supported, ceases to be present, the previous impressions
disappear, and a void is offered for the reception of new ones,
equally vivid, but equally superficial.

This mixture of susceptibility and indifference makes the


Frenchman a gay and pleasing, but, at the same time, an uncertain
companion; he does not, like the Englishman, dwell on the
enjoyments of the past, and entangle his mind with useless and
prolonged regrets, but is ever ready to enliven new scenes of social
intercourse; in short, he can ill sustain a state of tristesse, which he
considers all his reflecting moments, and whether thrown into
contact with his countrymen, or strangers, is a sensualist in his social
feelings, and must seek for pleasure and amusement, for in this “he
lives and has his being,” and that man is his dearest friend, who
most contributes to his gratification.

With respect to the fair sex, they are generally lively and
fascinating, and possessed of susceptible feelings, capable of being
converted into strong attachments. These are some of the essential
requisites for forming an amiable, and virtuous character; but, alas!
the good is perverted by the influence of an injudicious and trifling
system of education, extended at most to superficial literary
acquisitions, which barely serve for the dictation of an ungrammatical
billetdoux, or the copying of a song. The most devoted attention is
given to the art of pleasing, and the study of dress, which, with the
auxiliaries of music and embroidery, form the leading occupations of
young French females.

In conversation they are acute, playful, and frequently sensible,


but it cannot be wondered at, when the defects of education are
taken into account, that there should be little which sinks deep into
the heart, and leaves an impression, or promise, of future matron-
like virtue.

Many ladies, however, are educated in convents, where they


acquire a temporary spirit of bigotry, which wears off after they return
into the world, and frequently leaves behind it a proportionate want
of religious feeling.
They, generally, marry young enough to enable a judicious
husband to form a character if defective, or to correct it if deformed;
but here they are truly to be pitied; for they soon experience a
culpable neglect from those men who ought to be their inseparable
protectors and advisers, and who, preferring the society of others,
leave them incautiously to their own pursuits and feelings. Is it to be
wondered at that they should cease to cultivate the domestic
virtues?

To conclude; the French female contains within her those


principles, which, under proper cultivation, would produce excellent
wives, and estimable women; and it is a serious reflection upon the
national character, that such principles should be sacrificed by the
indifference, and neglect of those whose duty, as well as interest it is,
to elicit and establish her virtues.
CHAP. X.
ST. ROSALIE.

My first object, on arriving at Nice, was to ascertain whether Mr. L


⸺, lately one of my acquaintance at Aix, was yet at Nice, where he
had been for a time residing, and of which I was doubtful, as I knew
that he was about this time intending to proceed farther into Italy. I
had been apprised that I should hear of him at the house of Madame
M⸺ at St. Rosalie, about a mile and a half distant from the town;
and, as I was aware that he had paved the way to an introduction for
me to this lady, I procured a valet-de-place to conduct me thither. I
had the happiness to find him still in the neighbourhood, residing at a
very short distance from Madame M⸺, although on the point of
proceeding on his proposed tour.

Through his recommendation, I was immediately received as an


inmate in the family of Madame M⸺, consisting of herself, two
daughters, and a young English lady, Miss T⸺.

The mansion of this lady was an attachment to the adjoining


church of St. Rosalie, now fallen into disuse, except as a family
storeroom; the bells, and other ecclesiastical articles, had been
presented by Madame, to the neighbouring church of Cimea,
formerly a Roman settlement, with still some interesting remains of
an amphitheatre, baths, aqueduct, and a temple of Apollo; and
amongst which, ancient coins are still occasionally discovered.

The domain of St. Rosalie is delightfully situated, and furnished


with shady walks, which offer a cool retreat amidst the severest
heats of summer: there was one formed of trellis-work, over-
shadowed with the vine, which was peculiarly grateful; here we
frequently walked during the heats of the day, or amused ourselves
with the pleasures of reading; to gratify my inclination for which my
amiable companion Miss T⸺ would kindly devote many hours of
the day to the perusal of such authors as most interested me; indeed
I can never express sufficient gratitude for the many sacrifices she
made for my accommodation and amusement.

We here proposed to continue, until the nearer approach of winter,


would make a town-residence more agreeable. Our time passed
away in the most happy manner; Madame was busily occupied by
the vintage, and in laying up a stock of fruits, preserves, &c. in which
the young ladies occasionally assisted; nor could I remain an idle
personage, and I proved myself far more dexterous in cutting down
the bunches of grapes, than my companions were willing to have
given me credit for. It was necessary that as little time as possible,
should be lost in this operation, as exposure to wet, during the
gathering of the grapes, injures the flavour of the wine: we
succeeded in completing our task in two days.

The process of making the wine is as follows:—The grapes being


selected and picked, are put into a large vat, where they are well
trodden down by the naked feet; after which, the liquor is drawn off
from below; the bruised grapes are then put into a press, and the
remaining liquor extracted. The whole of the juice is now transferred
into casks with their bungs open, and allowed to ferment, and
discharge its impurities for twelve, fifteen, or twenty days, according
to the strength of the grape; the waste occasioned by the discharge
being constantly supplied with fresh liquor. The casks are then
carefully closed, and in about a month the wine is considered fit for
drinking.

When the grapes are of a bad, meagre kind, the wine-dealers mix
the juice with quicklime, in order to give it a spirit which nature has
denied, or, possibly, to take off acidity.

About this time, Dr. Skirving, an English physician, whom I had the
pleasure of knowing in Edinburgh, and an intimate acquaintance of
Madame M⸺, arrived with a view of establishing himself in
practice at Nice. He had originally become known at this place, in
consequence of having been detained in it by the illness of a friend,
who in an intended voyage from Civita Vecchia to Marseilles,
ruptured a blood-vessel on his lungs, by the exertions of sea-
sickness, and was compelled to make this port, where, after lingering
some months, he died. Pleased with the situation, and at the
solicitations of his friends, he determined to make Nice his
permanent residence, and having arranged his affairs in England,
was now arrived to carry the plan into execution.

With a cultivated and liberal mind, Dr. S⸺ is possessed of


superior professional abilities; I had the pleasure of witnessing an
interesting recovery, under his care, in the person of a lady who had
an abscess on her lungs. At one time she was considered so near
dissolution, that some of her friends were importunate to have the
last consolations of religion administered to her; but my friend, aware
of the danger of agitating her mind at this critical moment, entreated
that the measure might be deferred, and she was afterward restored
to comparative good health. If any apology is necessary for this
digression, it must be placed to the score of the warmest friendship;
indeed, I should feel myself ungrateful, did I neglect to acknowledge
this gentleman’s undeviating kindness to myself.

The 15th of October now arrived, which, being St. Therese’s day,
was the fête of Madame M⸺, as well as the anniversary of my
birth. The former circumstance it may be necessary to explain. It is
customary in this country to name children after some favourite saint,
to whose especial protection they may thus be supposed to be
committed; and hence, when the annual fête of their patron arrives, it
is made a day of congratulation to themselves.

When it happens to be the fête of the father, or mother of a family,


their children prepare a nosegay, and bring it to them the first thing in
the morning, presenting it with some pretty and appropriate address;
after which, the day is spent in innocent pastime and amusement.
But the above tokens of respect are not confined to the children; the
friends, and dependants, also participate in offering them. In the
present instance, I prepared my nosegay, and offered it to my fair
hostess with undefinable sensations of pleasure, and of course did
not allow so favourable an opportunity to pass, without adding that
well-merited compliment, which politeness, and gratitude for her
attentions prompted. Now Madame was a pretty little sensible
woman, who knew how to receive a compliment from a gentleman,
in a graceful and agreeable manner; and, I really cannot wonder that
the priests should appoint so many fêtes, if they are to be attended
with such agreeable circumstances to them, as I experienced on this
occasion.

Soon after this, the peasantry employed on Madame M⸺’s


estate, came with their nosegays, accompanied by presents of fruit,
and were regaled with breakfast; the day unfortunately proved rainy,
or we should have enjoyed a dance on the green. We had afterward
a party to dinner; and the evening concluded with singing, and other
amusements. On Madame M⸺’s brother being requested to sing
he favoured us with the following, first drawing his chair close to that
of Miss T⸺, to whom he appeared to address the sentiment.

J’avais juré que de l’amour


Je ne porterais plus la chaine,
Redoutant les maux qu’il entraî
Je voulais le fuir sans retour
Mais de sa puissance divine,
Tout mortel se rit vainement.
Lorsque je faisais ce serment
Je n’avais pas vu ma voisine.

Depuis long temps ce Dieu malin


Piqué de mon indifference,
Preparait tout bas sa vengeance:
Voyez combien l’amour est fin.
Sous les traits d’Aglae, et d’Aline,
Ne pouvant effleurer mon cœur,
Pour réussir le seducteur,
Prend ceux de ma belle voisine.
Si j’avais le talent heureux
De Zeuxis, ou de Praxitele,
Je peindrais la vertu si belle,
Qu’elle plairait à tous les yeux.
Elle aurait les traits de Cyprine,
De Junon l’air majestueux,
D’Hebé le souris gracieux;
Mais non! je piendrais ma voisine.

Qu’un soldat aime les lauriers,


Qu’on cueille au champ de la victoire;
Qu’un savant sur son vieux grimoire,
Se confonde des jours entiers,
Qu’un buveur, que rien ne chagrine,
A boire mette son plaisir.
Moi je ne forme qu’un desir,
C’est d’être aimé de ma voisine.

The air becoming sensibly cooler, it was determined to remove to


our winter-quarters in Nice, leaving St. Rosalie to its peasantry, now
about to commence getting in the olives, and express the oil, which
is the richest part of their harvest. The best olives are those which
grow wild, but the quantity of these is inconsiderable; they begin to
collect them in the early part of November, and this is repeated at
intervals until March or April; the fruit is beaten off the trees with long
canes as it ripens, which is known by its turning from a light green to
a very dark colour. The oil must be expressed immediately, and
before the olives fade or grow wrinkled, otherwise it will not be good.
The whole are, in the first instance, ground into paste by a millstone,
set edgeways in a circular stone trough, and turned by a mule or the
power of water; this paste is then put into cases, made of the same
kind of grass which is so much used in the Mediterranean for the
manufacture of ropes and cables; six or eight of which are piled one
over the other, and then subjected to a powerful press for a few
minutes, by which the oil is forced out, and received into a stone
reservoir placed beneath it. While the oil is passing from the press,
hot water is frequently dashed over it, to make it flow the better. The
whole fluid is now transferred into a wooden vat, half filled with
water, in which the dregs fall to the bottom, while the supernatant oil
is skimmed off, and stored up in small oblong casks.

The remnant is now thrown into a large stone cistern containing


water, and allowed to continue there twelve or fourteen days,
frequently stirring it during that time; a coarser oil is then taken from
its surface, which serves for the purpose of burning in lamps, or in
manufactories. After these processes, they separate an oil still more
coarse and fetid, and occasionally grind the paste down with hot
water, which extracts a yet greater quantity of oily matter, but which
in this case soon grows rancid.

The dregs which remain after these operations, when dried, are
used as a fuel; particularly for warming, by means of brasieres,
apartments without chimneys.

There is, however, a very peculiarly fine preparation, called virgin


oil, and which is a great delicacy, eating like the sweetest butter; this
is made from green olives, and sold at a high price, as a great
quantity of the fruit yields but little oil.

The summer fruits, as grapes, figs, peaches, &c. were now over,
but we had great stores preserved for the winter’s use. There were,
however, neither oranges nor lemons this season, the unusually
severe frost of the preceding winter having killed all the trees:
throughout France, and about Genoa, most of the olive-trees also
perished; but at Nice they were more fortunate.

It may be interesting, to advert to the mode of life of the peasantry


of this district, and the nature of the tenure by which they hold their
land, as well as the manner of cultivating it.

The Nicean peasant is frugal and industrious, he takes no regular


meal, not even a breakfast, until after the conclusion of the labours
of the day, contenting himself with an occasional refreshment of
bread, wine, and fruit; at night he makes amends for this abstinence,
but even now rarely partakes of animal food, his favourite and
indispensable fare being soup, prepared with macaroni and
vegetables, and mixed up with a large quantity of oil.

The land around the city is divided into small parcels or farms,
seldom consisting of more than twelve or fourteen acres each, and
which are principally covered with vines, olives, and fruit-trees, the
intermediate spaces being filled up with abundance of vegetables,
and small quantities of grain, the chief supply of this important article
being derived from different parts of the Mediterranean.

The proprietor retains the actual possession of the farm, but the
fermier cultivates it, collects its produce, and carries it to market; he
is bound also to plant, every year, a stipulated number of vines, from
three to six hundred, according to the size of the farm; and at his
sole expense to repair the walls and fences. The proprietor provides
him a house, pays the contribution foncier, and incurs half the
expense of manure, and of the animals necessary for carrying on the
various operations of the concern. The proprietor and fermier then
share the produce in equal proportions, except as relates to the
olives, of which the former takes three-fifths.

The ground is entirely cultivated by a kind of hoe, termed piochê;


the valuable instrument, the plough, being unknown in the whole
country; nor do they here seem acquainted with the use of carts, as
even the manure is conveyed in baskets, or barrels, on the backs of
mules.

We now took leave of St. Rosalie; nor could I, without the highest
regret, tear myself away from its rural charms, not least amongst
which was the vine covered alley, “impervious to the noontide ray,”
which had so often offered us delightful shade, and refreshment,
during the most intense atmospheric heats; and where so many
happy moments had glided away in interesting conversation, and the
rational amusement of reading, frequently enlivened by the vocal
powers of Madame M⸺ and her youngest daughter.

I thought I could have reposed for ever in this semblance of an


earthly paradise; and yet there was something which, in my situation,
I felt still wanting to make me completely blest.

“Rapt in the soft retreat, my anxious breast


Pants still for something unpossessed;
Whence springs this sudden hope, this warm desire?
To what enjoyment would my soul aspire?
’Tis love! extends my wishes and my care,
Eden was tasteless ’till an Eve was there.
Almighty Love! I own thy powerful sway,
Resign my soul, and willingly obey.”—Church.
CHAP. XI.
NICE.

We took up our residence at Nice, on the 17th of October in the


house of M. Audoli, situated in the suburb called St. John the Baptist:
opposite to us, a plank lay across the Paglion, which, when the water
was low afforded a ready access to the town; the bridge leading into
it, being situated at a considerable distance higher up.

Nice is far from being a large city, as I was able to make the tour of
its ramparts in twenty minutes; nor is it an interesting one; the streets
are narrow, and mostly on a level, with the exception of one or two
which lead to a part of the town situated in a hollow, and which have
a step every two or three yards to break the declivity.

In many streets you are annoyed by the thumping of machinery,


employed in the manufacture of macaroni, and which is required to
force it into its tubular form. The following is the process for
manufacturing the ordinary kind of macaroni or vermicelli: Equal
parts of fine and coarse flour are mixed together, and made into a
paste with water, to which a small quantity of saffron has been added
to give it a yellow tinge. The whole is then kneaded into a stiff paste,
by means of a beam of wood, which is worked by two or three men
on the principle of the lever; after which it is put into a strong cylinder
of copper, with perforations in its bottom, of such size as may be
necessary to give the form of macaroni or vermicelli, which ever may
be intended. It is then forced through these apertures into its tubular
shape by a powerful screw, and cut of proper lengths as it comes
out, after which it is hung up in the air to harden.

One street, termed Rue de Juif, is exclusively appropriated to the


Jews, who are not allowed to reside in any other part of the town.
The places, St. Dominico and Victoire, are respectable squares:
the York hotel is situated in the former, which affords visitors
superior, and at the same time equally reasonable, accommodation,
with the Hotel des Etranger.

The most general residence for strangers, however, is beyond the


suburb of St. John the Baptist, at a part termed the Croix de Marbre,
where a number of houses, superior, in point of comfort, to the
residence of the natives, are kept for the purpose of accommodating
them: houses may, however, also be procured on the Cimea Hill,
near the Port, in the Places, and by the Terrace, as well as in other
parts of the town. The prices are variable, according to the season,
situations, and demand for them; and what you pay will be materially
influenced by your skill in bargaining: the prudent plan is to offer only
half what they ask, and from thence ascend, as they descend, until
both agree, or you are satisfied that you have proposed a fair price;
and then if you stick to your point, they will most probably accede to
it. This is a better way of arranging the business, than through the
medium of your banker, who will probably offer his services as an
agent.

Nice has excellent markets, well supplied with provisions of all


kinds, at reasonable prices: viz. beef, five sous per pound; mutton,
six sous; veal and lamb, seven sous; but the pound consists only of
twelve ounces, and not, as in France, of from sixteen to twenty-two.
The price of butchers’ meat is fixed by the magistracy, and therefore
invariable, whereas that of poultry and butter fluctuates, these
articles being brought from the plains of Piedmont over the Col de
Tende, at times impassable; which circumstance of course enhances
the value. Game is scarce, and nearly as dear as in England; six
francs being given for a brace of woodcocks: hares, however, are
more moderate in proportion. Fish is plentiful, when the weather is
favourable, and sells from six to sixteen sous per pound. Vegetables
and fruits are grown abundantly in the environs.

Nice produces very fair wines, both red and white; but the most
valuable kind is that named Billit.
The accommodations for bathing are indifferent; the beach is
rough and stony, and there are no machines. On summer evenings,
after it is dark, the females take possession of the beach, on one
side of the entrance of the harbour, and there bathe, while the men
go to a distant point.

There are, however, two sets of warm baths in the town, the one
constructed of marble, the other with copper; the former, situated
near the Place St. Dominico, are long, narrow, and shallow; when in
them, you only want a cover to make a good coffin—the latter, on the
contrary, situated on the ramparts between the bridge and the Place
Victoire, are so short and deep, that although you cannot lie down in
them, you may sit, and have the water up to your chin; in fact they
form excellent boilers, which would serve to stew you down, if
required.

Among the many beautiful walks about Nice, the Terrace ranks
foremost; it is crowded on a summer’s evening, but during the winter
is delightful throughout the whole day, particularly on a Sunday
afternoon, when a military band occasionally attends for an hour or
two. The walks to the Port, and around the ramparts, are also very
agreeable.

In the environs of the town, a great deal of beautiful scenery will


be found, embellished with aqueducts, temples, and other Roman
remains, particularly in the direction of the Cimea road; and that
leading to Genoa, from which there is a most commanding view of
the sea, Nice, and its neighbourhood, with the Paglion flowing in the
valley beneath, the Turin road lying by the side of it, over which, on
the opposite side of the river, stands the Cimea Hill.

Only three good carriage roads will be found at Nice, one leading
to the Var, another to Turin, and the third to Genoa; there is also one
to Villa Franca, but so steep, that many do not like to venture up it;
the preferable way of visiting this latter place, is to row there in a
boat or felucca, and return on foot.
Villa Franca is a small, but strongly fortified town, distant about two
miles from Nice, built at the extremity of a fine harbour, in a situation
admirably adapted for the site of a more important place. It consists
of very indifferent buildings, and its streets are narrow, and
wretchedly paved.

Nice and its environs do not offer a very extensive field to the
naturalist. The surrounding mountains are, however, covered with a
great variety of plants during the whole year; and, of course, the
botanist will find ample amusement. The mineralogy of the
neighbourhood is but limited, the whole of the hills around the city
consisting chiefly of limestone, with some few beds of gypsum. In the
beds of the mountain torrents, portions are occasionally found of
granite, gneiss, clay-slate, flinty-slate, serpentine and feltspar; but
these specimens so small and so much weathered, that it is often
difficult to distinguish them.

The geology of Nice is more interesting; the calcareous rocks


afford many specimens of what the French call the breche osseuse,
in which small fragments of bones are cemented together by
argillaceous matter, which has acquired a reddish colour from the
presence of iron. Near Villa Franca some of the limestone contains a
great number of shells, the species of many of which still exist in the
Mediterranean. The rising grounds near the Var are wholly formed of
a coarse breccia, the cement of which is argillaceous, impregnated
with iron; extensive excavations have here been made to procure
clay for the manufacture of tiles, in which great numbers of shells are
found imbedded, with occasional vegetable remains.

I believe the sea-shore produces a number of shells which would


be interesting to the conchologist.

I shall now make some remarks respecting the state of society at


Nice. There were English residents enough to form sufficiently large
circles amongst themselves, besides numerous others who visited
the place, en passant, to and from Italy. A few German, and Russian,
families were also spending their winter here, who associated largely
with the English. These visited each other, and gave dinner, and
evening parties, and balls occasionally. The natives, however, were
not excluded from this society, although the incomes of few would
permit their returning the invitation in equal stile. The hospitality,
however, of the governor, made amends for the deficiency. This
officer, only gave dinner parties to the gentlemen; but had balls for
the ladies once a week during the Carnival; and evening parties, in
the same way, throughout the remainder of the winter, paying both
by himself, and his aid-de-camps, the greatest possible attention to
his visitors. He had, however, no regular government-house, and the
one which he occupied was scarcely large enough for the
accommodation of his numerous guests. The only ceremony
necessary to enable a stranger to receive his attentions, was to
leave his card, which the governor always acknowledged in person.

The nobility of Nice, never think of visiting their countrymen who


have not titles, notwithstanding many of them are people of great
respectability, as professional men, merchants, &c.; at the same
time, they have no objection to meet them at the houses of
strangers. It might have been conceived that the experience of the
French revolution would have taught them differently; besides, it is a
matter of no difficulty to procure a title, for I am informed that it only
costs sixty louis to purchase that of a count, and twenty-five to
become a baron. But let me not be mistaken for a leveller of
distinctions, no one has a greater respect for the Patrician order than
myself, when its dignities have been the meed of talent or of virtue.

“Order is Heaven’s first law, and this confest,


Some are, and must be, greater than the rest.”

It is, contemptible, however, to witness the pride of upstart


gentility, with nothing but the mere garnish of wealth to adorn it.

But possibly I may have been led by the force of circumstances to


contemplate the present subject in too strong a light; for alas! I have
long been incapable of being deceived by the outward appearance
of things, and habituated to estimate men by their manners, and
conversation, rather than their external and visible signs.
Now peace to the nobles: may they wisdom acquire,
Should their titles have come from their fathers or sire.

I was much surprised one day by a visit from a particular friend,


Mrs. R⸺, lately arrived from Paris, whom I had not seen for the
last seven years, and supposed to be in the West Indies. This lady
did me the favour to introduce me to Mr. and Mrs. K⸺, the friends
whom she had accompanied from Paris. Soon after I had the
pleasure of becoming acquainted with General B⸺, Mrs. A⸺,
and a number of other English residents, whose names it would be
tiresome to the reader to enumerate, from whom I afterwards
received a series of kind and friendly attentions, for which I feel
greatly indebted to them. I cannot, however, avoid particularizing Mr.
and Mrs. S⸺, whose permission to make use of their valuable
collection of books, proved a source of the highest satisfaction to
me.

A very pretty, but small theatre, has been erected at Nice, which
was not opened for dramatic representations during my residence
there. It was, however, made use of for two grand balls, given by a
select party of the nobles and gentlemen of Nice, to the stranger
residents; we were also entertained with a public concert in it; we
had, besides this, several private amateur concerts, in a large room
appropriated for such occasions, and supported by subscription,
each subscriber being allowed to introduce a certain number of
persons.

Before giving a dance at a private house, it is necessary, unless


you intend to break up by ten o’clock, to ask permission of the police,
who charge six francs for their licence, and then a soldier is placed
at the door of the house.

I accompanied a party of ladies, one Sunday, to the cathedral, to


hear an eminent French preacher, which is an unusual occurrence
here, for they generally preach either in Italian, or the patois of the
country, which is the most harsh and barbarous dialect I ever heard,
worse than the patois of Provence, which is bad enough, although
somewhat similar. It is however, the common language of the natives
when conversing together, notwithstanding most of the respectable
inhabitants speak both French and Italian.

I shall now notice various natural and meteorological occurrences


which took place during my residence in this city.

On the 3rd of January, the waters of the Paglion came down with
so much force, as to carry away the embankment, raised for the
protection of the workmen employed at the foundation of a new
bridge, just commenced over the river, and which was expected to
require two years to complete.

On the evening of the 6th of February, the shock of an earthquake


was sensibly perceived in some parts of the town, more particularly
on the side of the Turin gate; and on the 8th, the wind suddenly rose
to a violent gale, which lasted three or four hours; at the
commencement of which, Reaumur’s thermometer suddenly rose
from 3° to 10°. An American vessel which had left the port the day
before, for Marseilles, was upset during this gale, off Cannes, but the
crew were fortunately saved.

The coldest day experienced during the season, was on the 20th
of February, but even then, the lowest point at which Reaumur’s
thermometer was noticed, was 1° above freezing point, or equal to
34¼° of Fahrenheit.

The following is a register of the temperature of the atmosphere,


noted by Dr. S⸺, three times each day, during the first week of
January.

8 a.m. 2 p.m. 8 p.m.


January, 1820.
Reaum. Fahrt. Reaum. Fahrt. Reaum. Fahrt.
1st 3° 38¾° 7° 47¾° 2° 36½°
2nd 2° 36½° 6½° 46⅝° 5° 43½°
3rd 5½° 44¾° 7° 47¾° 9° 52½°
4th 7° 47¾° 9° 52½° 7½° 48⅞°
5th 7° 47¾° 8½° 51⅛° 9° 52½°
6th 8° 50° 1½° 35¾° 6° 45½°
7th 5° 43½° 9° 52½° 7½° 48⅞°

With respect to the climate of Nice, if I might be allowed, after five


months’ residence, to hazard an opinion, I conceive it the most
delightful one in Europe, and, indeed, preferable to any I have yet
experienced, unless the Bermuda islands are excepted. Some object
to the heat during summer, but it is possible to avoid the
inconvenience, by retiring for this season, amongst the mountains. At
a small town, named Rochabiliare, twenty-five miles inland, are
mineral springs, containing nitre and sulphur, and of different
temperatures, the highest being 100° Fahrenheit. I endeavoured, but
in vain, to procure a correct analysis of these waters.

My friends at Nice, with the exception of Dr. S⸺, thought me


insane, when, on the approach of spring, I declared my intention of
proceeding southward, to make the tour of Italy, as the whole of the
country was in an agitated state, in consequence of the advance of
the Austrians upon Naples, hostilities having actually commenced on
the frontiers. In addition, the Milanese and Piedmont were supposed
to be highly discontented, and an insurrection was anticipated
throughout the whole of Italy; but when my resolution is fixed, I do
not allow myself to be deterred by the anticipation, or dread of
difficulties; in the event of the fears of my friends being realized, I
was disposed to think I should have an equal, or better chance of
getting safely away from Florence, than from Nice; for instance, I
could, in a few hours reach Leghorn, at which place there would be
every probability of my being able to embark on board an English
vessel, or of getting to the neighbouring island where Lord Byron
desires Bonaparte to hasten, concluding his verse with a just
compliment to his own country.

“Then haste thee to thy sullen isle,


And gaze upon the sea;
That element may meet thy smile,
It ne’er was ruled by thee.”

On the contrary, in the event of a revolution at Nice, there would


be little chance of getting away, by sea or land. My ideas, in this
respect, were in some degree realized; a revolution did take place
there, and for three days the greatest consternation prevailed, as
there was an embargo laid upon all horses at Nice, in order to
facilitate the movements of the king and his government; and at the
same time not an English vessel off the port.

On arriving at Florence, it was my intention to regulate my future


movements according to circumstances, and the alternatives of
these it was not difficult to foresee. In the event of the Austrians
being successful in the first instance, the war was certain to be of
short duration; whereas, on the other hand, if the Neapolitans proved
able to support the onset, there was little doubt but that the whole of
Italy would be in arms, to assert its independence, and to compel a
free constitution from its rulers.

Influenced by these considerations, I determined to proceed, nor


have I found any reason to regret the decision.
CHAP. XII.
VOYAGE TO GENOA.

On the 26th of February, 1821, I left Nice in the Divine Providence


felucca, of eleven tons, bound to Genoa, with a freight of passengers
only, not having been able to procure a cargo.

Some time elapsed, after getting on board, before I felt able to


inquire into the persons, or characters of my fellow-passengers; my
mind was too deeply absorbed in the painful emotions, occasioned
by taking leave of a family with whom I had so long and happily
resided, and for whom I must ever entertain an affectionate regard.
In time, however, I found that, besides myself, our vessel contained
three English gentlemen, who, indeed, had taken their passage at
my suggestion, instead of pursuing their journey to Genoa, over
land, with mules, as they had intended. It was, however, their third
attempt to get farther into Italy by sea. They had first endeavoured to
reach Leghorn in an American vessel, which, on some account or
other, put back to Villa Franca: after this they sailed for Civita
Vecchia, but a contrary wind, and roughish sea arising, after they
had left port a few hours, the master of the vessel became
frightened, and notwithstanding, every argument to induce him to
persevere, returned to port. In order to make progress, it is
preferable to coast it in small vessels, rather than trust to the open
sea in larger traders, for they never keep out in bad weather, if it is
possible to reach a port.

Besides these gentlemen, our party consisted of three Frenchmen,


and two ladies, one French, and the other an Italian.

After leaving the harbour, the wind was light and variable, and the
water smooth, so that by dint of rowing and sailing, we proceeded at
the rate of three miles an hour. On arriving off the town, and
principality of Monaco, we stood towards the shore, and took on
board three sailors, belonging to a Sardinian frigate, lying at Genoa,
who had been visiting their friends at Monaco, and agreed to work
their passage back to the former place.

At sunset, the captain provided each of us with a straw mattress


for our repose; my companions, accordingly, laid themselves down
for the night on the floor of the cabin, but I placed mine in
preference, on the bench upon which I had been sitting.

We glided on smoothly until midnight, when the wind changed to


the eastward, accompanied by small rain. The master expecting bad
weather, now bore up for a small port called Cerf, where we
anchored about three o’clock in the morning; at seven, we landed at
the town of Cerf, situated on the side of so steep a hill, that the
streets consist of continued flights of steps. We were conducted to a
small auberge, the best however in the place, where we got some
hot water, and refreshed ourselves, after our miserable night, with
tea, cold meat, &c. of which we had been cautious to lay in good
stores before leaving Nice. The care of my friends had supplied
myself with no less than a couple of large tongues, a dozen loaves,
smoked herrings, coffee, sugar, wines, &c. I name these particulars,
because their kind consideration, in the sequel, proved important to
me.

After breakfast, the whole of our party, except the Italian lady and
myself, set off on mules for Genoa, we having determined to remain
in hopes of the wind shortly becoming favourable, in which case, we
doubted not, by pursuing our original plan, still to reach Genoa
before them, and avoid a difficult and expensive journey by land.

To amuse myself in the interim, I visited the church, and also a


miserable auberge, where our captain took me. We here found a
number of low-lived fellows, some playing at cards, and others
smoking, drinking, and quarrelling. On my return to the auberge, I
found the Italian lady solitary, and out of spirits, in consequence of
our detention. At five o’clock, we were asked to take refreshment,
and informed, that they could give us soup and macaroni, but, on
tasting the former, it was composed chiefly of water, with some
onions and vermicelli, and a large quantity of oil floating upon the
surface; this fare I could not relish, and determined to wait until we
returned on board, as we intended to do shortly, in order to take
advantage of any favourable change in the weather, and when I
could avail myself of my own stores.

After returning to the vessel, and making a hearty meal, we lay


down upon our mattresses as on the preceding night, myself on the
bench, the lady on the floor, and the captain and crew in the forepart
of the vessel.

The wind, which throughout the night had continued fresh, in the
morning became more moderate and favourable; soon after day-light
we weighed anchor, stood out of the harbour, and beat up along
shore during the day, making what sailors call a long leg and a short
one, or perhaps what will be more intelligible, a long tack and a short
one, the wind being three points on the right side of our noses; about
evening it freshened, and was fed by small rain. A Swedish brig
passed us at two p.m. which was running out of the gulf of Genoa,
with a fine fair wind. About eight in the evening, the wind had
increased in such a degree, that the captain thought it necessary to
seek shelter for the night, but it was become so dark, that in running
for a place he had been accustomed to, the vessel took ground,
under the lee of some small uninhabited island. The whole crew,
including himself, now made such a hue-and-cry, that one would
have thought, nothing less than immediate destruction was to be the
result of this mistake; however, we made shift to secure the vessel to
the rocks, with an anchor, and it was fortunate that we succeeded in
effecting this, for the wind soon increased to a tremendous gale, with
heavy rain, which continued through the present night, and the
following day and night also.

I had now plenty of occupation in calming the fears of my


companion, who, as may be imagined, became dreadfully alarmed;
partly with this intention, and partly from necessity, I changed my
mattress from the bench to the floor; for the former station was too
much exposed to the cold wind and rain, to make it longer tenable.
Our cabin was not a close room, but covered over with a tilted roof
like a waggon, and had temporary canvas screens, at each end, to
secure us from the weather.

At length I had the pleasure of succeeding in my attempts to


restore the lady’s confidence, and she afterward amply compensated
me by her cheerful manners, and agreeable conversation. Sterne
may dilate upon the delicacy of his situation by land, when shut up
for eight hours in a room, half as large as our whole ship, and a third
person in an adjoining closet, with a widow lady of thirty, who could
coolly draw up articles to regulate their conduct; but what was his
case compared with mine, enclosed, as I was, for two nights and a
day in the cabin of a vessel, and scarcely within hearing of a living
soul, with a young married female of five-and-twenty, and whom my
imagination might lead me to suppose beautiful as an Houri. The
whole of this time passed away like a night to me; for as it was cold,
we shut ourselves up close, to keep out the wind and rain; like our
sailors on the northern expedition, during this state of confinement, it
made no difference, whether we dined in the night or day, for it was
just as easy for me to serve out our provisions in the former, as in
the latter; and with respect to sleep, I think I had the best of it in the
day-time, as the lady’s fears were less on the qui vive, for whenever
the sea at night struck us a little harder than usual, she would cry out
in terror, “Monsieur! Monsieur! nous sommes contre les rochers,”
and I must have had indeed a heart of rock, had I not poured in all
possible consolation: I had the pleasure indeed of thinking that the
assurances of my animated tongue, were not less serviceable to her,
than the enjoyment of my lingua mortua, which no doubt contributed
very efficaciously to support her strength and spirits, for I soon found
by the lightness of the basket, that her own stores were insufficient
for so prolonged a voyage, or as sailors would express it, that she
was in danger of experiencing a southerly wind in the bread-bag.

It was true that this was Friday, but my fair companion was not in a
situation to think of maigre day, even had it been Vendrédi saint
itself. I believe the influence of the French Revolution, has
contributed materially to lessen the superstitions of the Catholic
countries, which have been exposed to its action. I have heard a
French officer remark, that for his part he had met with a sufficient
number of maigre days during the war, and could now afford no
more, but must live gras to make up for what he had lost. The priests
still contrive to make many women, children, and servants, observe
their ordinances, but the men have ventured, pretty generally, to
throw off their restraint.

On Saturday, soon after day-break, the lady, peeping out of a hole


in the canvas screen, found that the vessel was moving along, by
observing the masts pass by the trees on shore; and immediately
called out aloud for the captain. We at first attributed her
exclamations to her fears; but soon perceived that the ship was
actually drifting from the shore, and taking the anchor with her. All
hands were called, and the anchor got in, when we fortunately found
that the wind, although far from fair, had become moderate enough,
to allow us to make sail, and as the day advanced, it became still
more propitious. About four in the afternoon, we got round cape Noli,
being obliged however to make a few tacks to accomplish it; at this
point I heard the sea beating against the rocks, and roaring in the
hollow caverns, and could perceive, by the motion of the vessel, that
we were near breakers; but so long as our sailors expressed no
fears, I felt no apprehension, as I was satisfied, that while they could
use their eyes they would run no risk. The character of the Italian,
differs widely from that of the British sailor; the former loses his
presence of mind by his fears, and makes confusion more confused;
the latter, so long as his ship continues unbroken, retains his
undaunted spirit, and only contemplates how to apply his energies
with most effect.

“⸺E’en should danger round his fenceless head,


Her threatening weight of mountain surges spread,
He, like a whale, amid the tempest’s roar,
Smiles at the storm, nor deigns to wish it o’er.”
After weathering cape Noli, the wind became more favourable,
and allowed us to shape our course for Genoa, and had we pursued
it properly, I am persuaded that we might have made the lighthouse
of that place in four hours, but our captain, in reply to my urgency in
this respect, stated, what was certainly not unreasonable, that as his
provision was exhausted, if by any chance we should be blown off
the coast, the vessel might be lost, or the crew perish from hunger.
He therefore determined to put into Noli, off which place we
anchored at nine o’clock, when, with a part of his crew, he
immediately went on shore to procure provisions, and amuse
himself.

Noli was formerly a place of some repute, constituting a republic of


fishermen: it is now a mere fishing-town. The castle still remains.

The captain returned between ten and eleven o’clock, and,


according to my request, brought with him some bread and wine to
increase my little store. The bread had a peculiar sweet taste, which,
I was informed, was in consequence of chesnuts being mixed with
the wheaten flour. The wine was good, and made us merry before
lying down for the night, and we felt happy in the prospect of
reaching our destined port on the following day. In the early part of
the next morning, on passing Savona, the captain went on shore, to
order some new sails, which he stated were to be procured cheaper
there than at Genoa, and returned at twelve o’clock; when a contrary
breeze having sprung up, he declared his intention of running into
that port, as he was confident that we were going to have bad
weather, and should be obliged to put back to it at last. Thus we had
the mortification of being again detained at the distance of thirty
miles from Genoa, and only ten from the port we had left in the
morning, after having already occupied six days in a voyage, which,
with a fair passage, ought to have been completed in forty-eight
hours, and has sometimes been effected in sixteen.

We anchored at Savona about one o’clock, and experienced a


delightful afternoon. The port at this place is by nature very fine, and
was formerly capable of receiving vessels of war, but has been
obstructed materially at its entrance, by the jealousy of the Genoese,
under the specious pretence of preventing its harbouring hostile
shipping.

As there was no prospect of continuing our voyage to-day, my


companion and myself went on shore, after dinner, and amused
ourselves with a walk in the country; after an hour’s march, we
reached a small town, named Albisola, remarkable for its porcelain
manufactory; my companion saw, however, nothing but black plates:
on our way, we fell in with a genteel young man, a native of Albisola,
who gave us much local information; after which, we passed a lady
and gentleman, who, we were informed, were the mayor of the place
and his lady, on their way to a concert at Savona. We found Savona
a small neat town, pleasantly situated, and entering some of the
shops, made a few trifling purchases, and were remarkably struck
with the politeness of the Italian shop-keepers. On inquiring the time
of day, we were answered, “twenty-three hours and a half;” this
appeared a very extraordinary manner of noting the time: the fact is,
however, that, in Italy, their calculation always commences at sun-
set, which is their twenty-fourth hour, and consequently, must vary
according to the varying seasons of the year, which makes their
mode of computation exceedingly difficult for a stranger to
comprehend. In addition to the above, I had another indication of
being in Italy, from the universal use of that language; in short, my
companion conversed with every one in Italian, and then translated it
for me into French; and I was much pleased with the specimen I
here received both of the manners and language of the country.

In the evening we returned to our vessel to sleep, in order to be


prepared for any favourable change in the wind, but determined, in
case of its not shifting, to disembark with our baggage in the
morning, and proceed to Genoa by land. We were cheerful and
happy in the prospect of our difficulties being soon terminated, and
after regaling the crew with wine, retired to rest.

We rose with day-break, and finding the wind still adverse, after
settling with the captain, went on shore, and taking places in the
voiture to Genoa, determined no longer to be the sport of the winds.
There were but two vacancies in the coach, and finding our anxiety
to proceed with it, the conducteur would fain have taken advantage
of it, but the lady managed the affair well, for offering what she knew
to be the usual sum, viz. five francs for each of us; on their refusal to
accept it, under the plea that there was no other coach that day, we
walked off, and pretended to be indifferent about it: this manœuvre
brought them to, and before we had proceeded the length of a street,
the conducteur came running after us, to say that he was willing to
take us; after this, however, we had some trouble to get our luggage
to the carriage, and were obliged to walk part of the way out of town,
in doing which we were followed by the most importunate host of
beggars I had ever witnessed in my life; my companion was so
confused that she could with difficulty count out her money to pay
the porters, &c. At length our supplicants dropped off, one by one,
until we literally out-walked them all.

I ought not to take leave of Savona, without mentioning, that at this


point the maritime Alps terminate, and the Apennines commence.

About four o’clock, we passed through a village, stated to be the


birth-place of Columbus: this information excited much interest in my
mind: I was led to reflect upon the manner in which his extraordinary
genius had surmounted the various obstacles opposed to his
discovery of a new world, and to regret the supineness of my own
country, which might otherwise have had the honour of participating
in so important an event; but the enlivening conversation of our
party, would not admit of my indulging freely in such speculations,
and ere long we made our entry through the gates of Genoa.
CHAP. XIII.
GENOA.—VOYAGE TO LEGHORN, AND
JOURNEY TO FLORENCE.

The narrowness of the streets prevented our coach from setting


me down at the hotel to which I had been recommended; this is not,
however, to be regarded as any evidence of its want of respectability,
for the same objection lies against almost every other hotel in
Genoa: for there are but three streets in the whole city which will
admit of carriages passing each other, and which are, the Strada
balba, the Strada nuova, and the Strada novissima, consisting
entirely of ranges of palaces. I was disappointed in not finding
accommodation at the hotel in question, and therefore, on the
solicitations of a man who had followed me all the way from the
coach, went to the Piccolo Paregé, a large house near the port, with
a tower on the top of it, from whence there is a fine view of the
harbour and shipping. After enjoying the luxury of what was formerly
directed by some of the ancients as a religious ceremony, ablution, I
retired to a comfortable bed, for the first time since I left Nice.

In the morning, after calling at the post-office and at the British


consul’s to ascertain the state of the Neapolitan war, I proceeded to
explore the town; the weather was, however, wet, cold, and
uncomfortable, and I was sensible of a very different climate from
that of Nice; indeed, I was informed that, during some of our finest
days at the latter place, it rained or snowed at Genoa.

The succeeding day was the last of the Carnival, and a great
number of people were parading the streets masked, and in all the
fantastic garb of the season; the business, however, appeared to be
kept up with more spirit than at Toulouse on the preceding winter. In
the course of the evening a person with whom I was walking
addressed a female mask, who said she was cook in a gentleman’s
family, and that she must hasten home to wash the dishes; on
parting, we induced her to shake hands with us; and if I am a judge
of the affair, I pronounce that her hand had never been in dish-water,
for a prettier formed, or more delicate one, I never touched in my life.
In the evening, the festival concluded with masked-balls at the
theatres, and other amusements.

On the following day (Wednesday), the weather was still


unfavourable. Several gentlemen, to whom I had forwarded letters
from their friends at Nice, called upon me, two of whom conducted
me to various parts of the city, and described its beauties. It is
surrounded by two walls; an inner one, taking in a circumference of
six or seven miles, and an outer one, making a boundary of not less
than thirteen miles, and enclosing various rising grounds which
command the city: there are two fine bridges over small rivers, one in
the eastern, the other in the western part of the town.

Independent of the three streets which I have already named,


Genoa consists of little better than lanes, so numerous and intricate,
that a stranger is constantly losing his way; and even those who
have been some time resident are not unfrequently at a loss. The
cathedral, churches, Doge’s palace, and various other public as well
as private buildings, are very fine, and well worth the attention of the
traveller.

There is an Italian proverb relative to Genoa, which says, that it


has “sea without fish; land without trees; and men without faith.” The
first of these accusations I am satisfied is without foundation: for I
was given to understand that fish, as well as all other provisions,
were plentiful, and even cheaper than at Nice. The wine of the
country is not considered good, but excellent Italian and French
wines may be purchased at a reasonable rate; the best and
cheapest way of procuring them is to go on board some vessel in the
port, taste the different qualities, and select what pleases the palate;
any quantity may then be ordered, but it is advisable to be provided
with a porter or two to carry it away immediately, and to take care not
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!

ebookmass.com

You might also like