summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2004-08-09 11:02:09 +0200
committerunknown <ingo@mysql.com>2004-08-09 11:02:09 +0200
commit9694a1f9dd1ddbc667c40fc88b0d30e8c69985c6 (patch)
treef5d9dae27bdc16bb870c89d8f0231cc4db8cd80f /sql/ha_myisam.cc
parenta3630acb4198b5a16825f728ccdebdefc8d43999 (diff)
downloadmariadb-git-9694a1f9dd1ddbc667c40fc88b0d30e8c69985c6.tar.gz
bug#4369 - MySQL 4.1 regression in Alter table/tmp table from hash.
Solved performance problems by fixing a typo, which prevented enabling of write buffer. sql/ha_myisam.cc: bug#4369 - MySQL 4.1 regression in Alter table/tmp table from hash. Solved performance problems by fixing a typo, which prevented enabling of write buffer. Supplied no test case, as it required too much data to see the performance regression.
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 51c8521c376..3d2d25b3e7d 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -957,15 +957,21 @@ int ha_myisam::indexes_are_disabled(void)
start_bulk_insert(rows)
rows Rows to be inserted
0 if we don't know
+
+ NOTICE
+ Do not forget to call end_bulk_insert() later!
*/
void ha_myisam::start_bulk_insert(ha_rows rows)
{
+ DBUG_ENTER("ha_myisam::start_bulk_insert");
THD *thd=current_thd;
ulong size= min(thd->variables.read_buff_size, table->avg_row_length*rows);
+ DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu",
+ (ulong) rows, size));
/* don't enable row cache if too few rows */
- if (!rows && rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE)
+ if (! rows || (rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE))
mi_extra(file, HA_EXTRA_WRITE_CACHE, (void*) &size);
can_enable_indexes= (file->s->state.key_map ==
@@ -989,8 +995,22 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
mi_init_bulk_insert(file, thd->variables.bulk_insert_buff_size, rows);
}
}
+ DBUG_VOID_RETURN;
}
+/*
+ end special bulk-insert optimizations,
+ which have been activated by start_bulk_insert().
+
+ SYNOPSIS
+ end_bulk_insert()
+ no arguments
+
+ RETURN
+ 0 OK
+ != 0 Error
+*/
+
int ha_myisam::end_bulk_insert()
{
mi_end_bulk_insert(file);