Oracle 5.0 Reference Manual page 707

Table of Contents

Advertisement

To obtain faster insertions for transactional tables, you should use
instead of
COMMIT
Locking also lowers the total time for multiple-connection tests, although the maximum wait time for
individual connections might go up because they wait for locks. Suppose that five clients attempt to
perform inserts simultaneously as follows:
• Connection 1 does 1000 inserts
• Connections 2, 3, and 4 do 1 insert
• Connection 5 does 1000 inserts
If you do not use locking, connections 2, 3, and 4 finish before 1 and 5. If you use locking,
connections 2, 3, and 4 probably do not finish before 1 or 5, but the total time should be about 40%
faster.
INSERT, UPDATE, and
performance by adding locks around everything that does more than about five successive inserts
or updates. If you do very many successive inserts, you could do a
UNLOCK TABLES
This would still result in a nice performance gain.
is still much slower for loading data than
INSERT
strategies just outlined.
• To increase performance for
key cache by increasing the
Server
Parameters".
8.3.2.2. Speed of
UPDATE
An update statement is optimized like a
speed of the write depends on the amount of data being updated and the number of indexes that are
updated. Indexes that are not changed do not get updated.
Another way to get fast updates is to delay updates and then do many updates in a row later.
Performing multiple updates together is much quicker than doing one at a time if you lock the table.
For a
MyISAM
split the row. If you do this often, it is very important to use
Section 13.7.2.5,
8.3.2.3. Speed of
DELETE
The time required to delete individual rows is exactly proportional to the number of indexes.
To delete rows more quickly, you can increase the size of the key cache by increasing the
key_buffer_size
To delete all rows from a table,
tbl_name. Truncate operations are not transaction-safe; an error occurs when attempting one in the
course of an active transaction or active table lock. See
8.3.2.4. Speed of
REPAIR TABLE
REPAIR TABLE
the same performance optimizations apply:
myisamchk
performance by setting these variables, as described in
Usage".
Optimizing
LOCK
TABLES.
operations are very fast in MySQL, but you can obtain better overall
DELETE
once in a while (each 1,000 rows or so) to permit other threads to access the table.
MyISAM
key_buffer_size
Statements
table that uses dynamic row format, updating a row to a longer total length may
"OPTIMIZE TABLE
Statements
[458]
system variable. See
TRUNCATE TABLE tbl_name
Statements
for
tables is similar to using
MyISAM
has variables that control memory allocation. You may be able to its improve
Non-SELECT
Statements
LOAD DATA
tables, for both
LOAD DATA INFILE
[458]
system variable. See
query with the additional overhead of a write. The
SELECT
OPTIMIZE TABLE
Syntax".
Section 8.9.2, "Tuning Server
Section 13.1.21,
myisamchk
Section 4.6.3.6,
687
START TRANSACTION
followed by an
LOCK TABLES
INFILE, even when using the
and INSERT, enlarge the
Section 8.9.2, "Tuning
occasionally. See
Parameters".
is faster than than
DELETE FROM
"TRUNCATE TABLE
for repair operations, and some of
"myisamchk
and
Syntax".
Memory

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents