7
MySQL Table Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
7.1
MyISAM Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
7.1.1
Space Needed for Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497
7.1.2
MyISAM Table Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497
7.1.2.1
Static (Fixed-length) Table Characteristics . . . . . . . . . . . . . . . . . . . . .498
7.1.2.2
Dynamic Table Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
7.1.2.3
Compressed Table Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . 499
7.1.3
MyISAM Table Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
7.1.3.1
Corrupted MyISAM Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
7.1.3.2
Clients is using or hasn't closed the table properly. . . . . . . . . . . . . 500
7.2
MERGE Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
7.2.1
MERGE Table Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .503
7.3
ISAM Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
7.4
HEAP Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
7.5
InnoDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
7.5.1
InnoDB Tables Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506
7.5.2
InnoDB Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507
7.5.3
Creating InnoDB Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .512
7.5.3.1
If Something Goes Wrong in Database Creation . . . . . . . . . . . . . . .513
7.5.4
Creating InnoDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
7.5.4.1
Converting MyISAM Tables to InnoDB. . . . . . . . . . . . . . . . . . . . . . . . . 514
7.5.4.2
Foreign Key Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
7.5.5
Adding and Removing InnoDB Data and Log Files. . . . . . . . . . . . . . . 516
7.5.6
Backing up and Recovering an InnoDB Database . . . . . . . . . . . . . . . .517
7.5.6.1
Checkpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .518
7.5.7
Moving an InnoDB Database to Another Machine. . . . . . . . . . . . . . . . .518
7.5.8
InnoDB Transaction Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .519
7.5.8.1
Consistent Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .519
7.5.8.2
Locking Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
7.5.8.3
Next-key Locking: Avoiding the Phantom Problem. . . . . . . . . . . . . . 520
7.5.8.4
Locks Set by Dierent SQL Statements in InnoDB . . . . . . . . . . . . . . 521
7.5.8.5
Deadlock Detection and Rollback. . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
7.5.8.6
An Example of How the Consistent Read Works in InnoDB . . . . . 522
7.5.8.7
How to cope with deadlocks? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .523
7.5.9
Performance Tuning Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
7.5.9.1
The InnoDB Monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
7.5.10
Implementation of Multi-versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . .527
7.5.11
Table and Index Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
7.5.11.1
Physical Structure of an Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .528
7.5.11.2
Insert Buering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .528
7.5.11.3
Adaptive Hash Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
7.5.11.4
Physical Record Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .529
7.5.11.5
How an Auto-increment Column Works in InnoDB . . . . . . . . . . . . 529
7.5.12
File Space Management and Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . 530
7.5.12.1
Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
7.5.12.2
File Space Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
7.5.12.3
Defragmenting a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
7.5.13
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .532
7.5.14
Restrictions on InnoDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
7.5.15
InnoDB Contact Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533
7.6
BDB or BerkeleyDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533
7.6.1
Overview of BDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .534
7.6.2
Installing BDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
7.6.3
BDB startup options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
7.6.4
Characteristics of BDB tables: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .535
7.6.5
Things we need to x for BDB in the near future: . . . . . . . . . . . . . . . . . . 536
7.6.6
Operating systems supported by BDB . . . . . . . . . . . . . . . . . . . . . . . . . .537
7.6.7
Restrictions on BDB Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .537
7.6.8
Errors That May Occur When Using BDB Tables . . . . . . . . . . . . . . . . .537
Chapter_1
|
Chapter_2
|
Chapter_3
|
Chapter_4
|
Chapter_5
|
Chapter_6
|
Chapter_7
|
Chapter_8
|
Chapter_9
Return to Table of Contents
.com
.net
.org
Web Hosting Services
UNIX WEB HOSTING
MERCHANT ACCOUNTS
DEDICATED SERVERS
E-COMMERCE HOSTING
SUPPORT & FAQ's
TERMS OF USE
Domain Services
DOMAIN
REGISTRATION
MANAGE
YOUR ACCOUNT
SUPPORT & FAQ's
TERMS OF USE
Corporate Info
ABOUT US
OUR NETWORK
CONTACT US
SITE MAP
Home
UNIX Web Hosting
|
Merchant Accounts
|
Dedicated Hosting
|
E-Commerce Hosting
Domain Registration
|
About Us
|
Our Network
|
Contact Us
|
Site Map
Terms of Use
|
Privacy Policy
|
Guarantees
Our Partners
iDeveloperNetwork - Software Development Company
SpiritHost - web hosting for spiritual and education sites
SpiritHit.com - Religious and Spiritual Portal
Copyright © 2002
Dyntex Group
, Inc. All Rights Reserved
Return to Table of Contents
Back to top