Commit 115baf77 authored by sun's avatar sun

#269561 by smk-ka: Performance: Disable indices to speed up import.

parent 2244c371
......@@ -6,6 +6,7 @@ Demo x.x-x.x, xxxx-xx-xx
Demo 5.x-1.x, xxxx-xx-xx
------------------------
#269561 by smk-ka: Performance: Disable indices to speed up import.
#272526 by smk-ka: Added file size to snapshot list.
#268056 by sun: Fixed incomplete snapshots due to max_execution_time reached.
#265801 by smk-ka: Added exclusion of data in cache tables for snapshots.
......
......@@ -80,6 +80,9 @@ function _demo_dump_table_data($table) {
// Get table fields.
if ($fields = _demo_get_fields($result)) {
// Disable indices to speed up import.
$output .= "/*!40000 ALTER TABLE $table DISABLE KEYS */;\n";
// Escape backslashes, PHP code, special chars
$search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a");
$replace = array('\\\\', "''", '\0', '\n', '\r', '\Z');
......@@ -144,6 +147,9 @@ function _demo_dump_table_data($table) {
if ($current_row > 0) {
$output .= ";\n";
}
// Enable indices again.
$output .= "/*!40000 ALTER TABLE $table ENABLE KEYS */;\n";
}
return $output;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment