This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Bulk Loader | |
Bulk load into a new InnoDB table via a temporary MyISAM memory table. | |
~2x faster than LOAD DATA direct into InnoDB table. | |
From https://gist.github.com/Tinram/18bcbbaeaee648ccde1b8ddfeb1d6f63 | |
Note: MEMORY table 2x faster, but requires max_heap_table_size pre-calculation; memory shunting/algos = poor performance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL 5.7.33 | |
# 1 million rows, 66MB CSV file | |
# 2022-09-06 | |
## standard way into an InnoDB table; slow | |
# LOAD DATA LOCAL INFILE 'products.csv' INTO TABLE import FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (col1, col2, col3, col4) | |
-- Query OK, 1000000 rows affected (1 min 10.47 sec) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just proof-of-concept GTID replication, no security in the following set-up: | |
$ docker pull mysql | |
# Create Docker containers from offical MySQL image | |
$ docker run --name master -e MYSQL_ROOT_PASSWORD=password -d mysql | |
$ docker run --name replica -e MYSQL_ROOT_PASSWORD=password -d mysql | |
# get docker master container IP: | |
docker inspect master | grep IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Garbage = { | |
/** | |
* Garbage text filler generator. | |
* @author Tinram | |
*/ | |
/** |