diff options
author | unknown <monty@mashka.mysql.fi> | 2002-12-14 12:45:31 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-12-14 12:45:31 +0200 |
commit | b512c8b83a52a7ef44e33b1b2c7e53dc64d28826 (patch) | |
tree | 3788562d6e317e766885341d638abf4c2828870d /sql/ha_myisam.cc | |
parent | fd977631f596f72080f39a6af7c0a33568f7ad1f (diff) | |
download | mariadb-git-b512c8b83a52a7ef44e33b1b2c7e53dc64d28826.tar.gz |
Transactions in AUTOCOMMIT=0 mode didn't rotate binary log
Don't enable any bulk insert or record caching code if inserting less than MIN_ROWS_TO_USE_BULK_INSERT rows (100)
myisam/mi_check.c:
Fixed bug in copying statistics for disabled index
mysql-test/r/distinct.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/fulltext.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/insert.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/key_diff.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/order_by.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/select.result:
Fix result after not doing key statistics for first insert.
mysql-test/r/show_check.result:
Fix result after not doing key statistics for first insert.
sql/ha_myisam.cc:
Don't disable index when inserting only a few rows
sql/log.cc:
Transactions in AUTOCOMMIT=0 mode didn't rotate binary log.
sql/sql_insert.cc:
Don't enable any bulk insert or record caching code if inserting less than MIN_ROWS_TO_USE_BULK_INSERT
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index fcef1284385..797fe97ea74 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -682,17 +682,24 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows) mi_extra(file, HA_EXTRA_NO_KEYS, 0); else { - /* Only disable old index if the table was empty */ - if (file->state->records == 0) + /* + Only disable old index if the table was empty and we are inserting + a lot of rows. + We should not do this for only a few rows as this is slower and + we don't want to update the key statistics based of only a few rows. + */ + if (file->state->records == 0 && + rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT) mi_disable_non_unique_index(file,rows); else { mi_init_bulk_insert(file, - current_thd->variables.bulk_insert_buff_size, rows); - table->bulk_insert= 1; + current_thd->variables.bulk_insert_buff_size, + rows); + table->bulk_insert= 1; + } } } - } enable_activate_all_index=1; } else |