Learning Mysql



Download 4.24 Mb.
View original pdf
Page248/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   244   245   246   247   248   249   250   251   ...   366
Learning MySQL
Table Types | 271

The InnoDB table type includes the following features:
Support for transactions
This is discussed at the start of this section.
Advanced crash recovery features
The InnoDB table type uses logs, which are files that contain the actions that
MySQL has taken to change the database. With the combination of a log and the database, MySQL can recover effectively from power losses, crashes, and other basic database failures. Of course, nothing can help you recover from loss of a machine, failure of a disk drive, or other catastrophic failures. For these, you need offsite backups and new hardware.
Row-level locking
We’ve explained how MyISAM locks at the table level, and the advantages and disadvantages of this. InnoDB locks at the row level, meaning that only the rows of data that are affected are unavailable to other users, which promotes better concurrency (sharing) of resources in certain circumstances. For applications that write more data than they read, or for applications that change large amounts of data when they do, InnoDB maybe abetter choice than MyISAM.
Foreign-key support
InnoDB is currently the only MySQL table type that supports foreign keys.
Fast, flexible indexing
The InnoDB type chooses the right data structure for the task when you create an index. It can switch from the fast, exact-match hash index to the fast, all-around
B-tree index as the need arises, giving you fast searching for most applications without you having to explicitly set the index type.
The InnoDB type has the following limitations:
More features means more to understand
You need to know about transactions, foreign keys, data versioning, and other features to use it effectively.
It’s difficult to setup iIt hastens of startup parameters and options, and to use it effectively, you need to understand and tune these. If you’re planning on using it, you need to know its details because that’s why you’ve chosen it over MyISAM. Tuning InnoDB requires a book of its own!
It’s disk-hungry
To support its transaction-safe and robust behavior, InnoDB needs extra disk space. MyISAM is much more compact because it doesn’t have these features.
Locking overheads
Row locking is more complex than table locking, and so it’s slower and takes more memory.

Download 4.24 Mb.

Share with your friends:
1   ...   244   245   246   247   248   249   250   251   ...   366




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

    Main page