Skip to content

Instantly share code, notes, and snippets.

@abhibeckert
Created December 17, 2014 23:05
Show Gist options
  • Save abhibeckert/f24e301138174483b098 to your computer and use it in GitHub Desktop.
Save abhibeckert/f24e301138174483b098 to your computer and use it in GitHub Desktop.
// as many inserts as possible before 30 second timeout hits
// 226,465 inserts
// auto_increment int(11)
while (1) {
$uuidstr = gen_uuid();
$uuidbin = DB::escape(pack("h*", str_replace('-', '', $uuidstr)));
DB::query("insert into test values ()");
}
// 266,992 inserts
// binary(16)
while (1) {
$uuidstr = gen_uuid();
$uuidbin = DB::escape(pack("h*", str_replace('-', '', $uuidstr)));
DB::query("insert into test set id = '$uuidbin'");
}
// 267,644 inserts
// binary(36)
while (1) {
$uuidstr = gen_uuid();
$uuidbin = DB::escape(pack("h*", str_replace('-', '', $uuidstr)));
DB::query("insert into test set id = '$uuidstr '");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment