You can use raw disk partitions as data files in the
This technique enables nonbuffered I/O on Windows and on some Linux
and Unix systems without file system overhead. Perform tests with
and without raw partitions to verify whether this change actually
improves performance on your system.
When you create a new data file, put the keyword
newraw immediately after the data file size in
partition must be at least as large as the size that you specify.
Note that 1MB in
InnoDB is 1024 × 1024
bytes, whereas 1MB in disk specifications usually means 1,000,000
[mysqld] innodb_data_home_dir= innodb_data_file_path=/dev/hdd1:3Gnewraw;/dev/hdd2:2Gnewraw
The next time you start the server,
newraw keyword and initializes the
new partition. However, do not create or change any
InnoDB tables yet. Otherwise, when you next
restart the server,
InnoDB reinitializes the
partition and your changes are lost. (As a safety measure
InnoDB prevents users from modifying data when
any partition with
newraw is specified.)
InnoDB has initialized the new partition,
stop the server, change
newraw in the data file
[mysqld] innodb_data_home_dir= innodb_data_file_path=/dev/hdd1:3Graw;/dev/hdd2:2Graw
Then restart the server and
changes to be made.
On Windows, you can allocate a disk partition as a data file like this:
[mysqld] innodb_data_home_dir= innodb_data_file_path=//./D::10Gnewraw
//./ corresponds to the Windows syntax of
\\.\ for accessing physical drives.
When you use a raw disk partition, ensure that the user ID that runs
the MySQL server has read and write privileges for that partition.
For example, if you run the server as the
user, the partition must be readable and writeable by
mysql. If you run the server with the
--memlock option, the server must be
root, so the partition must be readable
and writeable by