Learning Mysql



Download 4.24 Mb.
View original pdf
Page250/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   246   247   248   249   250   251   252   253   ...   366
Learning MySQL
Table Types | 273


+-----------+---------------------------+
| 1 | New Order |
| 2 | Nick Cave & The Bad Seeds |
| 3 | Miles Davis |
| 4 | The Rolling Stones |
| 5 | The Stone Roses |
| 6 | Kylie Minogue |
| 7 | The Beatles |
| 8 | The Cure |
+-----------+---------------------------+
8 rows inset sec)
You can see in the second statement that we’ve misspelled the name of the band The
Who, so we’ve decided to
ROLLBACK
the transaction. You can see that the rollback was successful, since the
SELECT
statement shows the artist wasn’t added.
BDB
The Berkeley Database (BDB) table type can survive the same types of database crashes as the InnoDB table type, and also has the
COMMIT
and
ROLLBACK
functionality we showed you in the previous section. The Berkeley DB software itself is developed by Sleepycat
Software (http://www.sleepycat.com) and is modified to work with MySQL. While Berkeley DB is very stable and is used by over 200 million installations in a very wide range of products, the interface between MySQL and Berkeley DB is still underdevelopment and so the MySQL BDB table type is not yet widely used. Inbuilt support for this table type was dropped from MySQL version 5.1.12 onward. If you really need to use this table type, you can add support for it as a plugin storage table, but that’s outside the scope of this book.
This table type includes the following features:
Transaction support
See our earlier description of transactions in Transactions and Locking.”
Advanced crash-recovery features
See our earlier description in “InnoDB” fora discussion of logging and recovery.
Page-level locking
We’ve explained how MyISAM and InnoDB lock at the table and row levels, respectively. The BDB locking philosophy lies somewhere between the two, locking typically a block of rows that reside in a physical disk-drive block.
Fast primary-key indexing
The primary key index is stored with the data, and MySQL can avoid accessing the data itself if you require only columns that are part of the primary key. However,
this also means that you must have a primary-key index. MySQL will automatically create a hidden five-byte primary key if you don’t specify one. It’s also slower to scan all rows in a table if required fora query.
The BDB type has the following limitations:

Download 4.24 Mb.

Share with your friends:
1   ...   246   247   248   249   250   251   252   253   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page