Download the full version of the ebook at
https://ebookmass.com
Database Management Systems Ramakrishnan 3rd
Edition Raghu Ramakrishnan
https://ebookmass.com/product/database-management-
systems-ramakrishnan-3rd-edition-raghu-
ramakrishnan/
Explore and download more ebook at https://ebookmass.com
Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.
Database Systems Design, Implementation, and Management
12th Edition (eTextbook) PDF
https://ebookmass.com/product/database-systems-design-implementation-
and-management-12th-edition-etextbook-pdf/
testbankdeal.com
Database Systems: Design, Implementation, and Management
13th Edition Carlos Coronel
https://ebookmass.com/product/database-systems-design-implementation-
and-management-13th-edition-carlos-coronel/
testbankdeal.com
Database Principles: Fundamentals of Design,
Implementation, and Management 3rd Edition Carlos Coronel
https://ebookmass.com/product/database-principles-fundamentals-of-
design-implementation-and-management-3rd-edition-carlos-coronel/
testbankdeal.com
Database Systems: A Practical Approach to Design,
Implementation, and Management 6th Edition Thomas M.
Connolly
https://ebookmass.com/product/database-systems-a-practical-approach-
to-design-implementation-and-management-6th-edition-thomas-m-connolly/
testbankdeal.com
Modern Database Management 12th Edition, (Ebook PDF)
https://ebookmass.com/product/modern-database-management-12th-edition-
ebook-pdf/
testbankdeal.com
eTextbook 978-0133544619 Modern Database Management
https://ebookmass.com/product/etextbook-978-0133544619-modern-
database-management/
testbankdeal.com
Concepts of database management 10th Edition Lisa
Friedrichsen
https://ebookmass.com/product/concepts-of-database-management-10th-
edition-lisa-friedrichsen/
testbankdeal.com
DATABASE PRINCIPLES 3rd Edition Carlos. Morris Coronel
(Steven. Crockett
https://ebookmass.com/product/database-principles-3rd-edition-carlos-
morris-coronel-steven-crockett/
testbankdeal.com
(eBook PDF) Modern Database Management 13th Edition by
Jeff Hoffer
https://ebookmass.com/product/ebook-pdf-modern-database-
management-13th-edition-by-jeff-hoffer/
testbankdeal.com
DATABASE MANAGEMENT
SYSTEMS
DATABASE MANAGEMENT
SYSTEMS
Third Edition
Raghu Ramakrishnan
University of Wisconsin
Madison, Wisconsin, USA
Johannes Gehrke
Cornell University
Ithaca, New York, USA
Boston Burr Ridge, IL Dubuque, IA Madison, WI New York San Francisco St. Louis
Bangkok Bogotá Caracas Kuala Lumpur Lisbon London Madrid Mexico City
Milan Montreal New Delhi Santiago Seoul Singapore Sydney Taipei Toronto
abc
To Apu, Ketan, and Vivek with love
To Keiko and Elisa
CONTENTS
PREFACE xxiv
Part I FOUNDATIONS 1
1 OVERVIEW OF DATABASE SYSTEMS 3
1.1 Managing Data 4
1.2 A Historical Perspective 6
1.3 File Systems versus a DBMS 8
1.4 Advantages of a DBMS 9
1.5 Describing and Storing Data in a DBMS 10
1.5.1 The Relational Model 11
1.5.2 Levels of Abstraction in a DBMS 12
1.5.3 Data Independence 15
1.6 Queries in a DBMS 16
1.7 Transaction Management 17
1.7.1 Concurrent Execution of Transactions 17
1.7.2 Incomplete Transactions and System Crashes 18
1.7.3 Points to Note 19
1.8 Structure of a DBMS 19
1.9 People Who Work with Databases 21
1.10 Review Questions 22
2 INTRODUCTION TO DATABASE DESIGN 25
2.1 Database Design and ER Diagrams 26
2.1.1 Beyond ER Design 27
2.2 Entities, Attributes, and Entity Sets 28
2.3 Relationships and Relationship Sets 29
2.4 Additional Features of the ER Model 32
2.4.1 Key Constraints 32
2.4.2 Participation Constraints 34
2.4.3 Weak Entities 35
2.4.4 Class Hierarchies 37
2.4.5 Aggregation 39
vii
viii Database Management Systems
2.5 Conceptual Design With the ER Model 40
2.5.1 Entity versus Attribute 41
2.5.2 Entity versus Relationship 42
2.5.3 Binary versus Ternary Relationships 43
2.5.4 Aggregation versus Ternary Relationships 45
2.6 Conceptual Design for Large Enterprises 46
2.7 The Unified Modeling Language 47
2.8 Case Study: The Internet Shop 49
2.8.1 Requirements Analysis 49
2.8.2 Conceptual Design 50
2.9 Review Questions 51
3 THE RELATIONAL MODEL 57
3.1 Introduction to the Relational Model 59
3.1.1 Creating and Modifying Relations Using SQL 62
3.2 Integrity Constraints over Relations 63
3.2.1 Key Constraints 64
3.2.2 Foreign Key Constraints 66
3.2.3 General Constraints 68
3.3 Enforcing Integrity Constraints 69
3.3.1 Transactions and Constraints 72
3.4 Querying Relational Data 73
3.5 Logical Database Design: ER to Relational 74
3.5.1 Entity Sets to Tables 75
3.5.2 Relationship Sets (without Constraints) to Tables 76
3.5.3 Translating Relationship Sets with Key Constraints 78
3.5.4 Translating Relationship Sets with Participation Constraints 79
3.5.5 Translating Weak Entity Sets 82
3.5.6 Translating Class Hierarchies 83
3.5.7 Translating ER Diagrams with Aggregation 84
3.5.8 ER to Relational: Additional Examples 85
3.6 Introduction to Views 86
3.6.1 Views, Data Independence, Security 87
3.6.2 Updates on Views 88
3.7 Destroying/Altering Tables and Views 91
3.8 Case Study: The Internet Store 92
3.9 Review Questions 94
4 RELATIONAL ALGEBRA AND CALCULUS 100
4.1 Preliminaries 101
4.2 Relational Algebra 102
4.2.1 Selection and Projection 103
4.2.2 Set Operations 104
Contents ix
4.2.3 Renaming 106
4.2.4 Joins 107
4.2.5 Division 109
4.2.6 More Examples of Algebra Queries 110
4.3 Relational Calculus 116
4.3.1 Tuple Relational Calculus 117
4.3.2 Domain Relational Calculus 122
4.4 Expressive Power of Algebra and Calculus 124
4.5 Review Questions 126
5 SQL: QUERIES, CONSTRAINTS, TRIGGERS 130
5.1 Overview 131
5.1.1 Chapter Organization 132
5.2 The Form of a Basic SQL Query 133
5.2.1 Examples of Basic SQL Queries 138
5.2.2 Expressions and Strings in the SELECT Command 139
5.3 UNION, INTERSECT, and EXCEPT 141
5.4 Nested Queries 144
5.4.1 Introduction to Nested Queries 145
5.4.2 Correlated Nested Queries 147
5.4.3 Set-Comparison Operators 148
5.4.4 More Examples of Nested Queries 149
5.5 Aggregate Operators 151
5.5.1 The GROUP BY and HAVING Clauses 154
5.5.2 More Examples of Aggregate Queries 158
5.6 Null Values 162
5.6.1 Comparisons Using Null Values 163
5.6.2 Logical Connectives AND, OR, and NOT 163
5.6.3 Impact on SQL Constructs 163
5.6.4 Outer Joins 164
5.6.5 Disallowing Null Values 165
5.7 Complex Integrity Constraints in SQL 165
5.7.1 Constraints over a Single Table 165
5.7.2 Domain Constraints and Distinct Types 166
5.7.3 Assertions: ICs over Several Tables 167
5.8 Triggers and Active Databases 168
5.8.1 Examples of Triggers in SQL 169
5.9 Designing Active Databases 171
5.9.1 Why Triggers Can Be Hard to Understand 171
5.9.2 Constraints versus Triggers 172
5.9.3 Other Uses of Triggers 172
5.10 Review Questions 173
Visit https://ebookmass.com
now to explore a rich
collection of eBooks and enjoy
exciting offers!
x Database Management Systems
Part II APPLICATION DEVELOPMENT 183
6 DATABASE APPLICATION DEVELOPMENT 185
6.1 Accessing Databases from Applications 187
6.1.1 Embedded SQL 187
6.1.2 Cursors 189
6.1.3 Dynamic SQL 194
6.2 An Introduction to JDBC 194
6.2.1 Architecture 196
6.3 JDBC Classes and Interfaces 197
6.3.1 JDBC Driver Management 197
6.3.2 Connections 198
6.3.3 Executing SQL Statements 200
6.3.4 ResultSets 201
6.3.5 Exceptions and Warnings 203
6.3.6 Examining Database Metadata 204
6.4 SQLJ 206
6.4.1 Writing SQLJ Code 207
6.5 Stored Procedures 209
6.5.1 Creating a Simple Stored Procedure 209
6.5.2 Calling Stored Procedures 210
6.5.3 SQL/PSM 212
6.6 Case Study: The Internet Book Shop 214
6.7 Review Questions 216
7 INTERNET APPLICATIONS 220
7.1 Introduction 220
7.2 Internet Concepts 221
7.2.1 Uniform Resource Identifiers 221
7.2.2 The Hypertext Transfer Protocol (HTTP) 223
7.3 HTML Documents 226
7.4 XML Documents 227
7.4.1 Introduction to XML 228
7.4.2 XML DTDs 231
7.4.3 Domain-Specific DTDs 234
7.5 The Three-Tier Application Architecture 236
7.5.1 Single-Tier and Client-Server Architectures 236
7.5.2 Three-Tier Architectures 239
7.5.3 Advantages of the Three-Tier Architecture 241
7.6 The Presentation Layer 242
7.6.1 HTML Forms 242
7.6.2 JavaScript 245
7.6.3 Style Sheets 247
Contents xi
7.7 The Middle Tier 251
7.7.1 CGI: The Common Gateway Interface 251
7.7.2 Application Servers 252
7.7.3 Servlets 254
7.7.4 JavaServer Pages 256
7.7.5 Maintaining State 258
7.8 Case Study: The Internet Book Shop 261
7.9 Review Questions 264
Part III STORAGE AND INDEXING 271
8 OVERVIEW OF STORAGE AND INDEXING 273
8.1 Data on External Storage 274
8.2 File Organizations and Indexing 275
8.2.1 Clustered Indexes 277
8.2.2 Primary and Secondary Indexes 277
8.3 Index Data Structures 278
8.3.1 Hash-Based Indexing 279
8.3.2 Tree-Based Indexing 280
8.4 Comparison of File Organizations 282
8.4.1 Cost Model 283
8.4.2 Heap Files 284
8.4.3 Sorted Files 285
8.4.4 Clustered Files 287
8.4.5 Heap File with Unclustered Tree Index 288
8.4.6 Heap File With Unclustered Hash Index 289
8.4.7 Comparison of I/O Costs 290
8.5 Indexes and Performance Tuning 291
8.5.1 Impact of the Workload 292
8.5.2 Clustered Index Organization 292
8.5.3 Composite Search Keys 295
8.5.4 Index Specification in SQL:1999 299
8.6 Review Questions 299
9 STORING DATA: DISKS AND FILES 304
9.1 The Memory Hierarchy 305
9.1.1 Magnetic Disks 306
9.1.2 Performance Implications of Disk Structure 308
9.2 Redundant Arrays of Independent Disks 309
9.2.1 Data Striping 310
9.2.2 Redundancy 311
9.2.3 Levels of Redundancy 312
9.2.4 Choice of RAID Levels 316
xii Database Management Systems
9.3 Disk Space Management 316
9.3.1 Keeping Track of Free Blocks 317
9.3.2 Using OS File Systems to Manage Disk Space 317
9.4 Buffer Manager 318
9.4.1 Buffer Replacement Policies 320
9.4.2 Buffer Management in DBMS versus OS 322
9.5 Files of Records 324
9.5.1 Implementing Heap Files 324
9.6 Page Formats 326
9.6.1 Fixed-Length Records 327
9.6.2 Variable-Length Records 328
9.7 Record Formats 330
9.7.1 Fixed-Length Records 331
9.7.2 Variable-Length Records 331
9.8 Review Questions 333
10 TREE-STRUCTURED INDEXING 338
10.1 Intuition For Tree Indexes 339
10.2 Indexed Sequential Access Method (ISAM) 341
10.2.1 Overflow Pages, Locking Considerations 344
10.3 B+ Trees: A Dynamic Index Structure 344
10.3.1 Format of a Node 346
10.4 Search 347
10.5 Insert 348
10.6 Delete 352
10.7 Duplicates 356
10.8 B+ Trees in Practice 358
10.8.1 Key Compression 358
10.8.2 Bulk-Loading a B+ Tree 360
10.8.3 The Order Concept 363
10.8.4 The Effect of Inserts and Deletes on Rids 364
10.9 Review Questions 364
11 HASH-BASED INDEXING 370
11.1 Static Hashing 371
11.1.1 Notation and Conventions 373
11.2 Extendible Hashing 373
11.3 Linear Hashing 379
11.4 Extendible vs. Linear Hashing 384
11.5 Review Questions 385
Part IV QUERY EVALUATION 391
Contents xiii
12 OVERVIEW OF QUERY EVALUATION 393
12.1 The System Catalog 394
12.1.1 Information in the Catalog 395
12.2 Introduction to Operator Evaluation 397
12.2.1 Three Common Techniques 398
12.2.2 Access Paths 398
12.3 Algorithms for Relational Operations 400
12.3.1 Selection 401
12.3.2 Projection 401
12.3.3 Join 402
12.3.4 Other Operations 404
12.4 Introduction to Query Optimization 404
12.4.1 Query Evaluation Plans 405
12.4.2 Multi-operator Queries: Pipelined Evaluation 407
12.4.3 The Iterator Interface 408
12.5 Alternative Plans: A Motivating Example 409
12.5.1 Pushing Selections 409
12.5.2 Using Indexes 411
12.6 What a Typical Optimizer Does 414
12.6.1 Alternative Plans Considered 414
12.6.2 Estimating the Cost of a Plan 416
12.7 Review Questions 417
13 EXTERNAL SORTING 421
13.1 When Does a DBMS Sort Data? 422
13.2 A Simple Two-Way Merge Sort 423
13.3 External Merge Sort 424
13.3.1 Minimizing the Number of Runs 428
13.4 Minimizing I/O Cost versus Number of I/Os 430
13.4.1 Blocked I/O 430
13.4.2 Double Buffering 432
13.5 Using B+ Trees for Sorting 433
13.5.1 Clustered Index 433
13.5.2 Unclustered Index 434
13.6 Review Questions 436
14 EVALUATING RELATIONAL OPERATORS 439
14.1 The Selection Operation 441
14.1.1 No Index, Unsorted Data 441
14.1.2 No Index, Sorted Data 442
14.1.3 B+ Tree Index 442
14.1.4 Hash Index, Equality Selection 444
14.2 General Selection Conditions 444
xiv Database Management Systems
14.2.1 CNF and Index Matching 445
14.2.2 Evaluating Selections without Disjunction 445
14.2.3 Selections with Disjunction 446
14.3 The Projection Operation 447
14.3.1 Projection Based on Sorting 448
14.3.2 Projection Based on Hashing 449
14.3.3 Sorting Versus Hashing for Projections 451
14.3.4 Use of Indexes for Projections 452
14.4 The Join Operation 452
14.4.1 Nested Loops Join 454
14.4.2 Sort-Merge Join 458
14.4.3 Hash Join 463
14.4.4 General Join Conditions 467
14.5 The Set Operations 468
14.5.1 Sorting for Union and Difference 469
14.5.2 Hashing for Union and Difference 469
14.6 Aggregate Operations 469
14.6.1 Implementing Aggregation by Using an Index 471
14.7 The Impact of Buffering 471
14.8 Review Questions 472
15 A TYPICAL RELATIONAL QUERY OPTIMIZER 478
15.1 Translating SQL Queries into Algebra 479
15.1.1 Decomposition of a Query into Blocks 479
15.1.2 A Query Block as a Relational Algebra Expression 481
15.2 Estimating the Cost of a Plan 482
15.2.1 Estimating Result Sizes 483
15.3 Relational Algebra Equivalences 488
15.3.1 Selections 488
15.3.2 Projections 488
15.3.3 Cross-Products and Joins 489
15.3.4 Selects, Projects, and Joins 490
15.3.5 Other Equivalences 491
15.4 Enumeration of Alternative Plans 492
15.4.1 Single-Relation Queries 492
15.4.2 Multiple-Relation Queries 496
15.5 Nested Subqueries 504
15.6 The System R Optimizer 506
15.7 Other Approaches to Query Optimization 507
15.8 Review Questions 507
Part V TRANSACTION MANAGEMENT 517
Contents xv
16 OVERVIEW OF TRANSACTION MANAGEMENT 519
16.1 The ACID Properties 520
16.1.1 Consistency and Isolation 521
16.1.2 Atomicity and Durability 522
16.2 Transactions and Schedules 523
16.3 Concurrent Execution of Transactions 524
16.3.1 Motivation for Concurrent Execution 524
16.3.2 Serializability 525
16.3.3 Anomalies Due to Interleaved Execution 526
16.3.4 Schedules Involving Aborted Transactions 529
16.4 Lock-Based Concurrency Control 530
16.4.1 Strict Two-Phase Locking (Strict 2PL) 531
16.4.2 Deadlocks 533
16.5 Performance of Locking 533
16.6 Transaction Support in SQL 535
16.6.1 Creating and Terminating Transactions 535
16.6.2 What Should We Lock? 537
16.6.3 Transaction Characteristics in SQL 538
16.7 Introduction to Crash Recovery 540
16.7.1 Stealing Frames and Forcing Pages 541
16.7.2 Recovery-Related Steps during Normal Execution 542
16.7.3 Overview of ARIES 543
16.7.4 Atomicity: Implementing Rollback 543
16.8 Review Questions 544
17 CONCURRENCY CONTROL 549
17.1 2PL, Serializability, and Recoverability 550
17.1.1 View Serializability 553
17.2 Introduction to Lock Management 553
17.2.1 Implementing Lock and Unlock Requests 554
17.3 Lock Conversions 555
17.4 Dealing With Deadlocks 556
17.4.1 Deadlock Prevention 558
17.5 Specialized Locking Techniques 559
17.5.1 Dynamic Databases and the Phantom Problem 560
17.5.2 Concurrency Control in B+ Trees 561
17.5.3 Multiple-Granularity Locking 564
17.6 Concurrency Control without Locking 566
17.6.1 Optimistic Concurrency Control 566
17.6.2 Timestamp-Based Concurrency Control 569
17.6.3 Multiversion Concurrency Control 572
17.7 Review Questions 573
xvi Database Management Systems
18 CRASH RECOVERY 579
18.1 Introduction to ARIES 580
18.2 The Log 582
18.3 Other Recovery-Related Structures 585
18.4 The Write-Ahead Log Protocol 586
18.5 Checkpointing 587
18.6 Recovering from a System Crash 587
18.6.1 Analysis Phase 588
18.6.2 Redo Phase 590
18.6.3 Undo Phase 592
18.7 Media Recovery 595
18.8 Other Approaches and Interaction with Concurrency Control 596
18.9 Review Questions 597
Part VI DATABASE DESIGN AND TUNING 603
19 SCHEMA REFINEMENT AND NORMAL FORMS 605
19.1 Introduction to Schema Refinement 606
19.1.1 Problems Caused by Redundancy 606
19.1.2 Decompositions 608
19.1.3 Problems Related to Decomposition 609
19.2 Functional Dependencies 611
19.3 Reasoning about FDs 612
19.3.1 Closure of a Set of FDs 612
19.3.2 Attribute Closure 614
19.4 Normal Forms 615
19.4.1 Boyce-Codd Normal Form 615
19.4.2 Third Normal Form 617
19.5 Properties of Decompositions 619
19.5.1 Lossless-Join Decomposition 619
19.5.2 Dependency-Preserving Decomposition 621
19.6 Normalization 622
19.6.1 Decomposition into BCNF 622
19.6.2 Decomposition into 3NF 625
19.7 Schema Refinement in Database Design 629
19.7.1 Constraints on an Entity Set 630
19.7.2 Constraints on a Relationship Set 630
19.7.3 Identifying Attributes of Entities 631
19.7.4 Identifying Entity Sets 633
19.8 Other Kinds of Dependencies 633
19.8.1 Multivalued Dependencies 634
19.8.2 Fourth Normal Form 636
19.8.3 Join Dependencies 638
Contents xvii
19.8.4 Fifth Normal Form 638
19.8.5 Inclusion Dependencies 639
19.9 Case Study: The Internet Shop 640
19.10 Review Questions 642
20 PHYSICAL DATABASE DESIGN AND TUNING 649
20.1 Introduction to Physical Database Design 650
20.1.1 Database Workloads 651
20.1.2 Physical Design and Tuning Decisions 652
20.1.3 Need for Database Tuning 653
20.2 Guidelines for Index Selection 653
20.3 Basic Examples of Index Selection 656
20.4 Clustering and Indexing 658
20.4.1 Co-clustering Two Relations 660
20.5 Indexes that Enable Index-Only Plans 662
20.6 Tools to Assist in Index Selection 663
20.6.1 Automatic Index Selection 663
20.6.2 How Do Index Tuning Wizards Work? 664
20.7 Overview of Database Tuning 667
20.7.1 Tuning Indexes 667
20.7.2 Tuning the Conceptual Schema 669
20.7.3 Tuning Queries and Views 670
20.8 Choices in Tuning the Conceptual Schema 671
20.8.1 Settling for a Weaker Normal Form 671
20.8.2 Denormalization 672
20.8.3 Choice of Decomposition 672
20.8.4 Vertical Partitioning of BCNF Relations 674
20.8.5 Horizontal Decomposition 674
20.9 Choices in Tuning Queries and Views 675
20.10 Impact of Concurrency 678
20.10.1 Reducing Lock Durations 678
20.10.2 Reducing Hot Spots 679
20.11 Case Study: The Internet Shop 680
20.11.1 Tuning the Database 682
20.12 DBMS Benchmarking 682
20.12.1 Well-Known DBMS Benchmarks 683
20.12.2 Using a Benchmark 684
20.13 Review Questions 685
21 SECURITY AND AUTHORIZATION 692
21.1 Introduction to Database Security 693
21.2 Access Control 694
21.3 Discretionary Access Control 695
xviii Database Management Systems
21.3.1 Grant and Revoke on Views and Integrity Constraints 704
21.4 Mandatory Access Control 705
21.4.1 Multilevel Relations and Polyinstantiation 707
21.4.2 Covert Channels, DoD Security Levels 708
21.5 Security for Internet Applications 709
21.5.1 Encryption 709
21.5.2 Certifying Servers: The SSL Protocol 712
21.5.3 Digital Signatures 713
21.6 Additional Issues Related to Security 714
21.6.1 Role of the Database Administrator 714
21.6.2 Security in Statistical Databases 715
21.7 Design Case Study: The Internet Store 716
21.8 Review Questions 718
Part VII ADDITIONAL TOPICS 723
22 PARALLEL AND DISTRIBUTED DATABASES 725
22.1 Introduction 726
22.2 Architectures for Parallel Databases 727
22.3 Parallel Query Evaluation 728
22.3.1 Data Partitioning 730
22.3.2 Parallelizing Sequential Operator Evaluation Code 730
22.4 Parallelizing Individual Operations 731
22.4.1 Bulk Loading and Scanning 731
22.4.2 Sorting 732
22.4.3 Joins 732
22.5 Parallel Query Optimization 735
22.6 Introduction to Distributed Databases 736
22.6.1 Types of Distributed Databases 737
22.7 Distributed DBMS Architectures 737
22.7.1 Client-Server Systems 738
22.7.2 Collaborating Server Systems 738
22.7.3 Middleware Systems 739
22.8 Storing Data in a Distributed DBMS 739
22.8.1 Fragmentation 739
22.8.2 Replication 741
22.9 Distributed Catalog Management 741
22.9.1 Naming Objects 741
22.9.2 Catalog Structure 742
22.9.3 Distributed Data Independence 743
22.10 Distributed Query Processing 743
22.10.1 Nonjoin Queries in a Distributed DBMS 744
22.10.2 Joins in a Distributed DBMS 745
Visit https://ebookmass.com
now to explore a rich
collection of eBooks and enjoy
exciting offers!
Contents xix
22.10.3 Cost-Based Query Optimization 749
22.11 Updating Distributed Data 750
22.11.1 Synchronous Replication 750
22.11.2 Asynchronous Replication 751
22.12 Distributed Transactions 755
22.13 Distributed Concurrency Control 755
22.13.1 Distributed Deadlock 756
22.14 Distributed Recovery 758
22.14.1 Normal Execution and Commit Protocols 758
22.14.2 Restart after a Failure 760
22.14.3 Two-Phase Commit Revisited 761
22.14.4 Three-Phase Commit 762
22.15 Review Questions 763
23 OBJECT-DATABASE SYSTEMS 772
23.1 Motivating Example 774
23.1.1 New Data Types 775
23.1.2 Manipulating the New Data 777
23.2 Structured Data Types 779
23.2.1 Collection Types 780
23.3 Operations on Structured Data 781
23.3.1 Operations on Rows 781
23.3.2 Operations on Arrays 781
23.3.3 Operations on Other Collection Types 782
23.3.4 Queries Over Nested Collections 783
23.4 Encapsulation and ADTs 784
23.4.1 Defining Methods 785
23.5 Inheritance 787
23.5.1 Defining Types with Inheritance 787
23.5.2 Binding Methods 788
23.5.3 Collection Hierarchies 789
23.6 Objects, OIDs, and Reference Types 789
23.6.1 Notions of Equality 790
23.6.2 Dereferencing Reference Types 791
23.6.3 URLs and OIDs in SQL:1999 791
23.7 Database Design for an ORDBMS 792
23.7.1 Collection Types and ADTs 792
23.7.2 Object Identity 795
23.7.3 Extending the ER Model 796
23.7.4 Using Nested Collections 798
23.8 ORDBMS Implementation Challenges 799
23.8.1 Storage and Access Methods 799
23.8.2 Query Processing 801
xx Database Management Systems
23.8.3 Query Optimization 803
23.9 OODBMS 805
23.9.1 The ODMG Data Model and ODL 805
23.9.2 OQL 807
23.10 Comparing RDBMS, OODBMS, and ORDBMS 809
23.10.1 RDBMS versus ORDBMS 809
23.10.2 OODBMS versus ORDBMS: Similarities 809
23.10.3 OODBMS versus ORDBMS: Differences 810
23.11 Review Questions 811
24 DEDUCTIVE DATABASES 817
24.1 Introduction to Recursive Queries 818
24.1.1 Datalog 819
24.2 Theoretical Foundations 822
24.2.1 Least Model Semantics 823
24.2.2 The Fixpoint Operator 824
24.2.3 Safe Datalog Programs 825
24.2.4 Least Model = Least Fixpoint 826
24.3 Recursive Queries with Negation 827
24.3.1 Stratification 828
24.4 From Datalog to SQL 831
24.5 Evaluating Recursive Queries 834
24.5.1 Fixpoint Evaluation without Repeated Inferences 835
24.5.2 Pushing Selections to Avoid Irrelevant Inferences 837
24.5.3 The Magic Sets Algorithm 838
24.6 Review Questions 841
25 DATA WAREHOUSING AND DECISION SUPPORT 846
25.1 Introduction to Decision Support 848
25.2 OLAP: Multidimensional Data Model 849
25.2.1 Multidimensional Database Design 853
25.3 Multidimensional Aggregation Queries 854
25.3.1 ROLLUP and CUBE in SQL:1999 856
25.4 Window Queries in SQL:1999 859
25.4.1 Framing a Window 861
25.4.2 New Aggregate Functions 862
25.5 Finding Answers Quickly 862
25.5.1 Top N Queries 863
25.5.2 Online Aggregation 864
25.6 Implementation Techniques for OLAP 865
25.6.1 Bitmap Indexes 866
25.6.2 Join Indexes 868
25.6.3 File Organizations 869
Random documents with unrelated
content Scribd suggests to you:
charging with a loose rein from behind their infantry, fell some on the
Portuguese and some on the thirteenth dragoons. So fiercely did
these last on both sides come together, that many men were
dismounted by the shock, and both parties pierced clear through to
the opposite side, then re-formed, and passed again in the same
fearful manner to their own ground: but Head’s troopers rallied
quicker than the French, and riding a third time closely in upon them,
overthrew horse and man, receiving at the same time the fire of the
infantry squares. Nevertheless, without flinching, they galloped upon
the battering train, hewed down the gunners, and, drawing up
beyond the French line of march, barred the way, in expectation that
the heavy cavalry would also fall on; but Beresford would not suffer
the latter to charge, and the French infantry returned for their guns
and resumed their march. The thirteenth and the Portuguese,
however, continued the pursuit, in a rash and disorderly manner,
even to the bridge of Badajos, and being repulsed by the guns of
that fortress, were followed by Mortier in person, and lost some
prisoners. Of the allies one hundred men were killed or hurt, and
above seventy taken. Of the enemy about three hundred suffered,
one howitzer was captured, and the French colonel Chamorin was
slain in single combat by a trooper of the thirteenth.
To profit from sudden opportunities, a general must be constantly
with his advanced guard in an offensive movement. When this
combat commenced, Beresford was with the main body, and baron
Trip, a staff-officer, deceived by appearances, informed him, that the
thirteenth had been cut off. Hence the marshal, anxious to save his
cavalry, which he knew could not be reinforced, would not follow up
the first blow, truly observing that the loss of one regiment was
enough. But the regiment was not lost, and, the country being open
and plain, the enemy’s force and the exact posture of affairs were
easy to be discerned. The thirteenth were reprimanded, perhaps
justly, for having pursued so eagerly without orders, yet the
unsparing admiration of the whole army consoled them.
Campo Mayor was thus recovered so suddenly, that the French
left eight hundred rations of bread in the magazines; and they also
evacuated Albuquerque and Valencia d’Alcantara, being infinitely
dismayed by the appearance of so powerful an army in the south:
indeed, so secretly and promptly had lord Wellington assembled it,
that its existence was only known to the French general by the blow
at Campo Mayor. But, to profit from such able dispositions, it was
necessary to be as rapid in execution, giving the enemy no time to
recover from his first surprise; and this was the more essential,
because the breach in Badajos was not closed, nor the trenches
obliterated, nor the exhausted magazines and stores replenished.
Soult had carried away six battalions and a regiment of cavalry, four
hundred men were thrown into Olivenza, three thousand into
Badajos; thus, with the losses sustained during the operations,
Mortier’s numbers were reduced to less than ten thousand men: he
could not therefore have maintained the line of the Guadiana and
collected provisions also, and Beresford should have instantly
marched upon Merida, driven back the fifth corps, and opened a
fresh communication by Jerumenha with Elvas; the fall of Badajos
would then have been inevitable. The confusion occasioned by the
sudden appearance of the army at Campo Mayor and the charge of
the thirteenth dragoons guaranteed the success of this march; the
English general might even have passed the river at Merida before
Mortier could have ascertained his object.
Beresford, neglecting this happy opportunity, put his troops into
quarters round Elvas, induced thereto by the fatigue and wants of
the soldiers; especially those of the fourth division, who had been
marching incessantly since the 6th of the month, and were bare-
footed and exhausted.
He had been instructed, by lord Wellington, to throw a bridge over
the Guadiana at Jerumenha; to push back the fifth corps; and to
invest Olivenza and Badajos. The Portuguese government had
undertaken not only to provide the means for these operations, but
had actually reported that they were collected at Elvas and
Jerumenha; that is to say, that provisions, shoes, battering guns,
ammunition, and transport were there; that the Guadiana abounded
in serviceable craft; that twenty large boats, formerly belonging to
Cuesta, which had been brought away from Badajos before the
siege, were at Elvas; and that all other necessaries would be sent
from Lisbon. It now appeared that no magazines of provisions or
stores had been formed; that very little transport was provided; that
only five of Cuesta’s boats had been brought from Badajos; that
there was no serviceable craft on the river, and that some small
pontoons, sent from Lisbon, were unfit to bear the force of the
current, or to sustain the passage of guns. The country, also, was so
deficient in provisions, that the garrison-stores of Elvas were taken to
feed the army.
All these circumstances combined to point out Merida as the true
line of operations; moreover, plenty of food was to be had on the left
bank of the Guadiana, and the measures necessary to remedy the
evil state of affairs on the right bank, did not require the presence of
an army to protect them. The great distress of the fourth division for
shoes, alone offered any serious obstacle; but, under the
circumstances, it would not have been too much to expect a
momentary effort from such an excellent division, or, it might without
danger even have been left behind.
Marshal Beresford preferred halting until he could procure the
means of passing at Jerumenha; an error which may be considered
as the first and principal cause of those long and bloody operations
which afterwards detained lord Wellington nearly two years on the
frontiers of Portugal. For, during Beresford’s delay, general Phillipon,
one of the ablest governors that ever defended a fortress, levelled
the trenches, restored the glacis, and stopped the breach;
meanwhile Latour Maubourg, who had succeeded Mortier in
command of the troops, covered the country with foraging parties
and filled the magazines.
Captain Squires, of the engineers, now undertook to bridge the
Guadiana under Jerumenha, by fixing trestle-piers on each side in
the shallows, and connecting them with the five Spanish boats;
wherefore, a squadron of cavalry was secretly passed over, by a
ford, to protect the workmen from surprise. The 3d of April, the
bridge being finished, the troops assembled during the night in the
woods near Jerumenha, being to cross at daylight; but the river
suddenly swelling, swept away the trestles, rendered the ford
impassable, and stopped the operations. No more materials could be
immediately procured, and the Spanish boats were converted into
flying bridges for the cavalry and artillery, while Squires constructed
a slight narrow bridge for infantry with the pontoons and with casks
taken from the neighbouring villages. To cover this operation a
battalion was added to the squadron already on the left bank, and
the army commenced passing the 5th of April; but it was late in the
night of the 6th, ere the whole had crossed and taken up their
position, which was on a strong range of hills, covered by a swampy
rivulet.
During this time, Latour Maubourg was so entirely occupied in
securing and provisioning Badajos, that his foragers were extended
fifty miles to the rear, and he took no notice whatever of Beresford’s
proceedings; an error savouring rather of the Spanish than of the
French method of making war: for it is evident that a moveable
column of five thousand infantry, with guns and cavalry, could have
easily cut off the small detachment of the British on the left bank, and
thus have completely frustrated the operations. The allied troops,
being most numerous, should have been carried over in the boats,
and entrenched on the other side in sufficient force to resist any
attack before the construction of the bridge was attempted: it is not
easy to say which general acted with most imprudence; Latour
Maubourg in neglecting, or Beresford in unnecessarily tempting
fortune.
When the British were in possession of the left bank, the French
general awaking, collected three thousand infantry, five hundred
cavalry, and four guns at Olivenza, whence he marched, at daylight
on the 7th, to oppose a passage which had been completed the day
before. He, however, surprised a squadron of the thirteenth, which
was in front, and then came so close up to the main body as to
exchange shots; yet he was permitted to retire unmolested, in the
face of more than twenty thousand men!
During these proceedings, the fifth Spanish army re-occupied
Valencia d’Alcantara and Albuquerque; having cavalry posts at La
Rocca and Montijo. Ballasteros also entered Fregenal, and
Castaños, who was appointed to command in Gallicia as well as
Estremadura, arrived at Elvas. This general was in friendly
intercourse with Beresford, but had a grudge against Blake. At first,
he pretended to the chief command, as the elder captain-general;
but Blake demanded a like authority over Beresford, who was not
disposed to admit the claim. Now Castaños, having little liking for a
command under such difficult circumstances, and being desirous to
thwart Blake, and fearful lest Beresford should, under these
circumstances, refuse to pass the Guadiana, arranged, that he who
brought the greatest force in the field should be generalissimo. Thus
the youngest officer commanded in chief.
Beresford, being joined by Madden’s cavalry, and having traced
out entrenchments capable of covering several thousand men,
ordered his bridges to be reconstructed in a more substantial
manner; brought up a Portuguese regiment of militia to labour at the
works; left a strong detachment of British infantry and some
Portuguese horse for their protection, and advanced with the
remainder of the army. Hereupon Latour Maubourg retired upon
Albuera, and Beresford summoned Olivenza on the 9th, apparently
expecting no defence; but the governor having rejected the
summons, the army encamped round the place, and major A.
Dickson was despatched to Elvas to prepare battering-guns for the
siege. The communication was now opened with Ballasteros at
Fregenal, and Castaños having carried Morillo’s division of infantry
and Penne Villamur’s cavalry from Montijo to Merida, pushed a part
on to Almendralejos. Latour Maubourg then retired to Llerena; and,
on the 11th, Beresford, leaving general Cole with the fourth division,
Madden’s cavalry, and a brigade of nine pounders to besiege
Olivenza, took post himself at Albuera; communicating, by his left,
with Almendralejos, and spreading his cavalry in front, so as to cut
off all communication with Badajos. The army now lived on the
resources of the country; and a brigade was sent to Talavera Real to
collect supplies.
The 14th, six twenty-four pounders reached Olivenza, and, being
placed in a battery constructed on the abandoned horn-work
formerly noticed, played with such success that the breach became
practicable before the morning of the 15th. Some riflemen posted in
the vineyards kept down the fire of the place, and the garrison,
consisting of three hundred and eighty men, with fifteen guns,
surrendered at discretion. Cole was immediately directed upon Zafra
by the road of Almendral; and Beresford, who had recalled the
brigade from Talavera, was already in movement for the same place
by the royal causeway. This movement was to drive Latour
Maubourg over the Morena, and cut off general Maransin. The latter
general had been in pursuit of Ballasteros ever since the retreat of
Zayas, and having defeated him at Fregenal on the 12th, was
following up his victory towards Salvatierra: an alcalde, however,
gave him notice of the allies approach, and he retreated in safety.
Meanwhile two French regiments of cavalry, advancing from Llerena
to collect contributions, had reached Usagre, where meeting with the
British cavalry, they were suddenly charged by the thirteenth
dragoons, and followed for six miles so vigorously that three hundred
were killed or taken, without the loss of a man on the part of the
pursuers.
On the 16th general Cole arrived from Olivenza, and the whole
army being thus concentrated about Zafra, Latour Maubourg retired
on the 18th to Guadalcanal; the Spanish cavalry then occupied
Llerena, and the resources of Estremadura were wholly at the
service of the allies. During these operations, general Charles Alten,
coming from Lisbon with a brigade of German light infantry, reached
Olivenza, and lord Wellington also arrived at Elvas, where Beresford,
after drawing his infantry nearer to Badajos, went to meet him. The
presence of the general-in-chief was very agreeable to the troops;
they had seen, with surprise, great masses put in motion without any
adequate results, and thought the operations had been slow, without
being prudent. The whole army was over the Guadiana on the 7th,
and, including the Spaniards from Montijo, Beresford commanded at
least twenty-five thousand men, whereas Latour Maubourg never
had more than ten thousand, many of whom were dispersed
foraging, far and wide: yet the French general had maintained
himself in Estremadura for ten days; and during this time, no corps
being employed to constrain the garrison of Badajos, the governor
continued to bring in timber and other materials for the defence, at
his pleasure.
Lord Wellington arrived the 21st. The 22d, he forded the Guadiana
just below the mouth of the Caya with Madden’s cavalry and Alten’s
Germans, pushing close up to Badajos. A convoy, escorted by some
infantry and cavalry, was coming in from the country, and an effort
was made to cut it off; but the governor sallied, the allies lost a
hundred men, and the convoy reached the town.
Lord Wellington, now considering that Soult would certainly
endeavour to disturb the siege with a considerable force, demanded
the assent of the Spanish generals to the following plan of combined
operations, before he would commence the investment of the place.
1º. That Blake, marching up from Ayamonte, should take post at
Xeres de los Cavalleros. 2º. That Ballasteros should occupy
Burquillo on his left. 3º. That the cavalry of the fifth army, stationed at
Llerena, should observe the road of Guadalcanal, and communicate
through Zafra, by the right, with Ballasteros. These dispositions were
to watch the passes of the Morena. 4º. That Castaños should furnish
three battalions for the siege, and keep the rest of his corps at
Merida, to support the Spanish cavalry. 5º. That the British army
should be in second line, and, in the event of a battle, Albuera,
centrically situated with respect to the roads leading from Andalusia
to Badajos, should be the point of concentration for all the allied
forces.
In consequence of the neglect of the Portuguese government, the
whole of the battering-train and stores for the siege were necessarily
taken from the ramparts and magazines of Elvas; the utmost
prudence was therefore required to secure the safety of these guns,
lest that fortress, half dismantled, should be exposed to a siege.
Hence, as the Guadiana, by rising ten feet, had again carried away
the bridge at Jerumenha on the 24th, lord Wellington directed the
line of communication with Portugal to be re-established by Merida,
until settled weather would admit of fresh arrangements.
Howbeit, political difficulties intervening obliged him to delay the
siege. The troops under Mendizabel had committed many excesses
in Portugal; the disputes between them and the inhabitants were
pushed so far, that the Spanish general pillaged the town of
Fernando; while the Portuguese government, in reprisal, meant to
seize Olivenza, which had formerly belonged to them. The Spanish
Regency publicly disavowed Mendizabel’s conduct, and Mr. Stuart’s
strenuous representations deterred the Portuguese from plunging
the two countries into a war; but this affair, joined to the natural
slowness and arrogance of the Spaniards, prevented both Castaños
and Blake from giving an immediate assent to the English general’s
plans: meanwhile, intelligence reached the latter that Massena was
again in force on the Agueda; wherefore, reluctantly directing
Beresford to postpone the siege until the Spanish generals should
give in their assent, or until the fall of Almeida should Appendix, No. II.
enable a British reinforcement to arrive, he repaired Section 10.
with the utmost speed to the Agueda.
O P E R AT I O N S I N T H E N O RT H .
During his absence, the blockade of Almeida had been closely
pressed, while the army was so disposed as to cut off all
communication. The allied forces were, however, distressed for
provisions, and great part of their corn came from the side of
Ledesma; being smuggled by the peasants through the French
posts, and passed over the Agueda by ropes, which were easily
hidden amongst the deep chasms of that river, near its confluence
with the Douro.
Massena was, however, intent upon relieving the place. His retreat
upon Salamanca had been to restore the organization and
equipments of his army, which he could not do at Ciudad Rodrigo,
without consuming the stores of that fortress. His cantonments
extended from San Felices by Ledesma to Toro, his cavalry was in
bad condition, his artillery nearly unhorsed: but from Bessieres he
expected, with reason, aid, both of men and provisions, and in that
expectation was prepared to renew the campaign immediately.
Discord, that bane of military operations, interfered. Bessieres had
neglected and continued to neglect the army of Portugal; symptoms
of hostilities with Russia were so apparent, even at this period, that
he looked rather to that quarter than to what was passing before him;
his opinion that a war in the north was inevitable was so openly
expressed as to reach the English army; and meanwhile, Massena
vainly demanded the aid, which was necessary to save the only
acquisition of his campaign.
A convoy of provisions had entered Ciudad Rodrigo on the 13th of
April; on the 16th a reinforcement and a second convoy also
succeeded in gaining that fortress, although general Spencer
crossed the Agueda, with eight thousand men, to intercept them; a
rear-guard of two hundred men was indeed, overtaken; but, although
surrounded by the cavalry in an open plain, they made their way into
the place.
Towards the end of the month, the new organization, decreed by
Napoleon, was put in execution. Two divisions of the ninth corps
joined Massena; and Drouet was preparing to march with the
remaining eleven thousand infantry and cavalry, to reinforce and
take the command of the fifth corps; when Massena, having
collected all his own detachments, and received a promise of
assistance from Bessieres, prevailed upon him to defer his march
until an effort had been made to relieve Almeida. With this view the
French army was put in motion towards the frontier of Portugal. The
light division immediately resumed its former positions, the left at
Gallegos and Marialva, the right at Espeja; the cavalry were
dispersed, partly towards the sources of the Azava, and partly
behind Gallegos, and, while in this situation, colonel O’Meara and
eighty men of the Irish brigade were taken by Julian Sanchez; the
affair having been, it was said, preconcerted, to enable the former to
quit the French service.
On the 23d, two thousand French infantry and a squadron of
cavalry marching out of Ciudad Rodrigo, made a sudden effort to
seize the bridge of Marialva; but the passage was bravely
maintained by captain Dobbs, with only a company of the fifty-
second and some riflemen.
On the 25th, Massena reached Ciudad Rodrigo; and the 27th, his
advanced guards felt all the line of the light division from Espeja to
Marialva. Lord Wellington arrived on the 28th, and immediately
concentrated the main body of the allies behind the Dos Casas river.
The Azava being swollen and difficult to ford, the enemy continued to
feel the line of the outposts; but, on the 2d of May, the waters having
subsided, the whole French army was observed coming out of
Ciudad Rodrigo, wherefore, the light division, after a slight skirmish
of horse at Gallegos, commenced a retrograde movement, from that
place and from Espeja, upon Fuentes Onoro. The country
immediately in rear of those villages was wooded as far as the Dos
Casas, but an open plain between the two lines of march offered the
enemy’s powerful cavalry an opportunity of cutting off the retreat. As
the French appeared regardless of this advantage, the division
remained in the woods bordering the right and left of the plain until
the middle of the night, when the march was renewed, and the Dos
Casas was crossed at Fuentes Onoro. This beautiful village had
escaped all injury during the previous warfare, although occupied
alternately, for above a year, by both sides. Every family in it was
well known to the light division, it was therefore a subject of deep
regret to find that the preceding troops had pillaged it, leaving only
the shells of houses where, three days before, a friendly population
had been living in comfort. This wanton act, was so warmly felt by
the whole army, that eight thousand dollars were afterwards
collected by general subscription for the poor inhabitants; yet the
injury sunk deeper than the atonement.
Lord Wellington had determined not to risk much to maintain his
blockade, and he was well aware that Massena, reinforced by the
army of the north and by the ninth corps, could bring down superior
numbers. Nevertheless, when the moment arrived, trusting to the
valour of his troops and the ascendancy which they had acquired
over the enemy during the pursuit from Santarem, he resolved to
abide a battle; but not to seek one, because his force, reduced to
thirty-two thousand infantry, twelve hundred cavalry in bad condition,
and forty-two guns, was unable, seeing the superiority of the French
horse, to oppose the enemy’s march.
The allies occupied a fine table-land, lying between the Turones
and the Dos Casas, the left at Fort Conception; the centre opposite
to the village of Alameda; the right at Fuentes Onoro; the whole
distance being five miles. The Dos Casas, flowing in a deep ravine,
protected the front of this line, and the French general could not, with
any prudence, venture to march, by his own right, against Almeida,
lest the allies, crossing the ravine at the villages of Alameda and
Fuentes Onoro, should fall on his flank, and drive him into the
Agueda. Hence, to cover the blockade, which was maintained by
Pack’s brigade and an English regiment, it was sufficient to leave the
fifth division near Fort Conception, and the sixth division opposite
Alameda. The first and third were then concentrated on a gentle rise,
about a cannon-shot behind Fuentes Onoro, where the steppe of
land which the army occupied turned back, and ended on the
Turones, becoming rocky and difficult as it approached that river.
F I R S T C O M B AT O F F U E N T E S O N O R O .
The French came up in three columns abreast, the cavalry, the
sixth corps, and Drouet’s division against Fuentes Onoro; but the
eighth and second corps against Alameda and Fort Conception,
seeming to menace the left of the position; wherefore, the light
division, after passing the Dos Casas, reinforced the sixth division.
General Loison however, without waiting for Massena’s orders, fell
upon Fuentes Onoro, which was occupied by five battalions of
chosen troops, detached from the first and third divisions.
Most of the houses of this village were quite in the bottom of the
ravine, but an old chapel and some buildings on a craggy eminence,
overhung one end. The low parts were vigorously defended; yet the
violence of the attack was so great, and the cannonade so heavy,
that the British abandoned the streets, and could scarcely maintain
the upper ground about the chapel. Colonel Williams, the
commanding officer, fell badly wounded, and the fight was becoming
very dangerous, when the twenty-fourth, the seventy-first, and the
seventy-ninth regiments, coming down from the main position,
charged so roughly, that the French were forced back, and, after a
severe contest, finally driven over the stream of the Dos Casas.
During the night the detachments were withdrawn; but the twenty-
fourth, the seventy-first, and seventy-ninth regiments were left in the
village, where two hundred and sixty of the allies and somewhat
more of the French had fallen.
On the 4th Massena arrived, and, being joined by Bessieres with
twelve hundred cavalry and a battery of the imperial guard,
examined all the line, and made dispositions for the next day. His
design was to hold the left of the allies in check with the second
corps, but to turn the right with the remainder of the army.
Forty thousand infantry, and five thousand horse, with thirty pieces
of artillery, were under arms, and they had shewn in the action of the
3d that their courage was not abated; it was, therefore, a very
audacious resolution in the English general to receive battle on such
dangerous ground. His position, as far as Fuentes Onoro, was
indeed strong and free for the use of all arms, and it covered his
communication by the bridge of Castello Bom; but, on his right flank,
the plain was continued in a second steppe to Nava d’Aver, where a
considerable hill overlooking all the country, commanded the roads
leading to the bridges of Seceiras and Sabugal. The enemy could,
therefore, by a direct march from Ciudad Rodrigo, place his army at
once in line of battle upon the right flank of the allies, and attack
them while entangled between the Dos Casas, the Turones, the
Coa, and the fortress of Almeida; and the bridge of Castello Bom
only would have been open for retreat. To prevent this stroke, and to
cover his communications with Sabugal and Seceiras, lord
Wellington, yielding to general Spencer’s earnest suggestions,
stretched his right wing out to Nava d’Aver, the hill of which he
caused Julian Sanchez to occupy, supporting him by the seventh
division, under general Houston. Thus the line of battle was above
seven miles in length, besides the circuit of blockade. The Dos
Casas, indeed, still covered the front; but above Fuentes Onoro, the
ravine became gradually obliterated, resolving itself into a swampy
wood, which extended to Poço Velho, a village half way between
Fuentes and Nava d’Aver. The left wing of the seventh division
occupied this wood and the village of Poço Velho, but the right wing
was refused.
B AT T L E O F F U E N T E S O N O R O .
It was Massena’s intention to have made his dispositions in the
night, in such a manner as to commence the attack at day-break on
the 5th; but a delay of two hours occurring, the whole of his
movements were plainly descried. The eighth corps withdrawn from
Alameda, and supported by all the French cavalry, was seen
marching above the village of Poço Velho, and at the same time the
sixth corps and Drouet’s division took ground to their own left, but
still keeping a division in front of Fuentes. At this sight the light
division and the English horse hastened to the support of general
Houston; while the first and third divisions made a movement parallel
to that of the sixth corps. The latter, however, drove the left wing of
the seventh division, consisting of Portuguese and British, from the
village of Poço Velho with loss, and was gaining ground in the wood
also, when the riflemen of the light division arriving at that point,
restored the fight. The French cavalry, then passing Poço Velho,
commenced forming in order of battle on the plain, between the
wood and the hill of Nava d’Aver. Julian Sanchez immediately retired
across the Turones, partly in fear, but more in anger, at the death of
his lieutenant, who, having foolishly ridden close up to the enemy,
making many violent gestures, was mistaken for a French officer,
and shot by a soldier of the guards, before the action commenced.
Montbrun occupied himself with this weak partida for an hour; but
when the Guerilla chief had fallen back, the French general turned
the right of the seventh division, and charged the British cavalry,
which had moved up to its support. The combat was unequal; for, by
an abuse too common, so many men had been drawn from the
ranks as orderlies to general officers, and for other purposes, that
not more than a thousand troopers were in the field. After one shock,
in which the enemy were partially checked and the French colonel
Lamotte taken fighting hand to hand, by general Charles Stewart, the
cavalry withdrew behind the light division. Houston’s people, being
thus entirely exposed, were charged strongly, and captain Ramsay’s
horse-artillery was cut off and surrounded. The light division instantly
threw itself into squares, but the main body of the French horsemen
were upon the seventh division, ere a like formation could be
effected: nevertheless the troops stood firm, and, although some
were cut down, the chasseurs Brittaniques, taking advantage of a
loose wall, received the attack with such a fire that the enemy
recoiled. Immediately after this, a great commotion was observed
amongst the French squadrons; men and officers closed in
confusion towards one point where a thick dust was rising, and
where loud cries and the sparkling of blades and flashing of pistols,
indicated some extraordinary occurrence. Suddenly the multitude
was violently agitated, an English shout arose, the mass was rent
asunder, and Norman Ramsay burst forth at the head of his battery,
his horses breathing fire and stretching like greyhounds along the
plain, his guns bounding like things of no weight, and the mounted
gunners in close and compact order protecting the rear. But while
this brilliant action was passing in one part, the enemy were making
progress in the wood, and the English divisions being separated and
the right wing turned, it was abundantly evident that the battle would
soon be lost, if the original position was not immediately regained.
In this posture of affairs lord Wellington directed the seventh
division to cross the Turones and move down the left bank to
Frenada, the light division to retire over the plain, the cavalry to
cover the rear. He also withdrew the first and third divisions, placing
them and the Portuguese in line on the steppe, before described as
running perpendicular to the ravine of Fuentes Onoro.
General Crawfurd, who had resumed the command of the light
division, first covered the passage of the seventh division over the
Turones, and then retired slowly over the plain in squares, having
the British cavalry principally on his right flank. He was followed by
the enemy’s horse, which continually outflanked him, and near the
wood surprised and sabred an advanced post of the guards, making
colonel Hill and fourteen men prisoners, but then continuing their
charge against the forty-second regiment, the French were repulsed.
Many times Montbrun made as if he would storm the light division
squares, but the latter were too formidable to be meddled with; yet,
in all this war, there was not a more dangerous hour for England.
The whole of that vast plain as far as the Turones was covered with
a confused multitude, amidst which the squares appeared but as
specks, for there was a great concourse, composed of commissariat
followers of the camp, servants, baggage, led horses, and peasants
attracted by curiosity, and finally, the broken piquets and parties
coming out of the woods. The seventh division was separated from
the army by the Turones, five thousand French cavalry, with fifteen
pieces of artillery, were close at hand impatient to charge; the
infantry of the eighth corps was in order of battle behind the
horsemen; the wood was filled with the skirmishers of the sixth
corps, and if the latter body, pivoting upon Fuentes, had issued forth,
while Drouet’s divisions fell on that village, while the eighth corps
attacked the light division, and while the whole of the cavalry made a
general charge; the loose multitude encumbering the plain would
have been driven violently in upon the first division, in such a manner
as to have intercepted the latter’s fire and broken their ranks.
No such effort was made; Montbrun’s horsemen merely hovered
about Crawfurd’s squares, the plain was soon cleared, the cavalry
took post behind the centre, and the light division formed a reserve
to the right of the first division, sending the riflemen amongst the
rocks to connect it with the seventh division, which had arrived at
Frenada and was there joined by Julian Sanchez.
At sight of this new front, so deeply lined with troops, the French
stopped short, and commenced a heavy cannonade, which did great
execution from the closeness of the allied masses; but twelve British
guns replied with vigour and the violence of the enemy’s fire abated;
their cavalry then drew out of range, and a body of French infantry
attempting to glide down the ravine of the Turones was repulsed by
the riflemen and the light companies of the guards. But all this time a
fierce battle was going on at Fuentes Onoro. Massena had directed
Drouet to carry this village at the very moment when Montbrun’s
cavalry should turn the right wing; it was, however, two hours later
ere the attack commenced. The three British regiments made a
desperate resistance, but overmatched in number, and little
accustomed to the desultory fighting of light troops, they were
pierced and divided; two companies of the seventy-ninth were taken,
colonel Cameron was mortally wounded, and the lower part of the
town was carried; the upper part was, however, stiffly held, and the
rolling of the musketry was incessant.
Had the attack been made earlier, and the whole of Drouet’s
division thrown frankly into the fight, while the sixth corps moving
through the wood closely turned the village, the passage must have
been forced and the left of the new position outflanked; but now lord
Wellington having all his reserves in hand, detached considerable
masses to the support of the regiments in Fuentes. The French
continued also to reinforce their troops until the whole of the sixth
corps and a part of Drouet’s division were engaged, when several
turns of fortune occurred. At one time the fighting was on the banks
of the stream and amongst the lower houses; at another upon the
rugged heights and round the chapel, and some of the enemy’s
skirmishers even penetrated completely through towards the main
position; but the village was never entirely abandoned by the
defenders, and, in a charge of the seventy-first, seventy-ninth, and
eighty-eighth regiments, led by colonel M’Kinnon against a heavy
mass which had gained the chapel eminence, a great number of the
French fell. In this manner the fight lasted until evening, when the
lower part of the town was abandoned by both parties, the British
maintaining the chapel and crags, and the French retiring a cannon
shot from the stream.
Vol. 3. Plate 11.
Battle of FUENTES ONORO
5TH MAY, 1811.
London Published by T. & W. Boone Novr 1830.
When the action ceased, a brigade of the light division relieved the
regiments in the village; and a slight demonstration by the second
corps near Fort Conception, having been repulsed by a battalion of
the Lusitanian legion, both armies remained in observation. Fifteen
hundred men and officers, of which three hundred were prisoners,
constituted the loss of the allies; that of the enemy was estimated at
the time to be near five thousand, but this exaggerated calculation
was founded upon the erroneous supposition that four hundred dead
were lying about Fuentes Onoro. All armies make rash estimates on
such occasions. Having had charge to bury the carcasses at that
point, I can affirm that, immediately about the village, not more than
one hundred and thirty bodies were to be found, one-third of which
were British.
During the battle, the French convoy for the supply of Almeida,
being held at Gallegos, in readiness to move, lord Wellington sent
Julian Sanchez from Frenada, to menace it, and to disturb the
communication with Ciudad Rodrigo. This produced no effect, and a
more decisive battle being expected on the 6th, the light division
made breast-works amongst the crags of Fuentes Onoro, while lord
Wellington entrenched that part of the position, which was
immediately behind this village, so that the carrying of it would have
scarcely benefitted the enemy. Fuentes Onoro, strictly speaking, was
not tenable; there was a wooded tongue of land on the British right,
that overlooked, at half-cannon shot, all the upper as well as the
lower part of the village both in flank and rear, yet was too distant
from the position to be occupied by the allies: had Ney been at the
head of the sixth corps, he would have quickly crowned this ridge,
and then Fuentes could only have been maintained by submitting to
a butchery.
On the 6th the enemy sent his wounded to the rear, making no
demonstration of attack, and as the 7th passed in a like inaction, the
British entrenchments were perfected. The 8th Massena withdrew
his main body to the woods leading upon Espeja and Gallegos, but
still maintained posts at Alameda and Fuentes. On the 10th, without
being in any manner molested, he retired across the Agueda; the
sixth and eight corps, and the cavalry, at Ciudad Rodrigo, the second
corps by the bridge of Barba del Puerco. Bessieres also carried off
the imperial guards, for Massena had been recalled to France, and
Marmont assumed the command of the army of Portugal.
Both sides claimed the victory; the French, because they won the
passage at Poço Velho, cleared the wood, turned our right flank,
obliged the cavalry to retire, and forced lord Wellington to relinquish
three miles of ground, and to change his front. The English, because
the village of Fuentes so often attacked, was successfully defended,
and because the principal object (the covering the blockade of
Almeida) was attained.
Certain it is, that Massena at first gained great advantages.
Napoleon would have made them fatal! but it is also certain that, with
an overwhelming cavalry, on ground particularly suitable to that arm,
the prince of Esling having, as it were, indicated all the errors of the
English general’s position, stopped short at the very moment when
he should have sprung forward. By some this has been attributed to
negligence, by others to disgust at being superseded by Marmont;
but the true reason seems to be, that discord in his army had arisen
to actual insubordination. The imperial guards would not charge at
his order; Junot did not second him cordially; Loison neglected his
instructions; Drouet sought to spare his own divisions in the fight;
and Reynier remained perfectly inactive. Thus the machinery of
battle being shaken, would not work.
General Pelet censures lord Wellington for not sending his cavalry
against Reynier after the second position was taken up; asserting
that any danger, on that side, would have forced the French to
retreat; but the criticism is unsustainable, being based on the notion
that the allies had fifty thousand men in the field, whereas, including
Sanchez’ Partida, they had not thirty-five thousand. It may be with
more justice objected to Massena that he did not Appendix, No. I.
launch some of his numerous horsemen, by the bridge Section 8.
of Seceiras, or Sabugal, against Guarda and Celerico, to destroy the
magazines, cut the communication, and capture the mules and other
means of transport belonging to the allied army. The vice of the
English general’s position would then have been clearly exposed,
for, although the second regiment of German hussars was on the
march from Lisbon, it had not passed Coimbra at this period, and
could not have protected the depôts. But it can never be too often
repeated that war, however adorned by splendid strokes of skill, is
commonly a series of errors and accidents. All the operations, on
both sides, for six weeks, furnished illustration of this truth.
Ney’s opposition had prevented Massena’s march upon Coria,
which would have secured Badajos and Campo Mayor, and,
probably, added Elvas to them. Latour Maubourg’s tardiness had like
to have cost Mortier a rear guard and a battering-train. By refusing
the line of Merida, Beresford enabled the French to secure Badajos.
At Sabugal, the petulance of a staff-officer marred an admirable
combination, and produced a dangerous combat. Drouet’s
negligence placed Almeida at the mercy of the allies, and a mistaken
notion of Massena’s sufferings during the retreat, induced lord
Wellington to undertake two great operations at the same time,
which were above his strength. In the battle of Fuentes Onoro, more
errors than skill were observable on both sides, and the train of
accidents did not stop there. The prize contended for presented
another example of the uncertainty of war.
E VA C U AT I O N O F A L M E I D A .
General Brennier, a prisoner at Vimiero, and afterwards
exchanged, was governor of this fortress. During the battle of
Fuentes Onoro, his garrison, consisting of fifteen hundred men,
skirmished boldly with the blockading force, and loud explosions,
supposed to be signals of communication with the relieving army,
were frequent in the place. When all hopes of succour vanished, a
soldier, named Tillet, contrived, with extraordinary courage and
presence of mind, to penetrate, although in uniform, through the
posts of blockade, carrying Brennier orders to evacuate the fortress.
The French general had, however, by crossing the Agueda, left
Almeida to its fate; the British general placed the light division in its
old position on the Azava with cavalry posts on the Lower Agueda,
and desired sir William Erskine to send the fourth regiment to Barba
del Puerco, while general Alexander Campbell continued the
blockade with the sixth division and with general Pack’s brigade.
Campbell’s dispositions were either negligently made, or
negligently executed. Erskine never transmitted the orders to the