insert into table_names (name) values (concat('t', convert($id, char)));
inc $counter;
}
let $data_size = `select count(*) from table_names`;
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
create table $table_name (i int) engine=innodb;
eval
insert into $table_name values (1), (2), (3), (4), (5);
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
update $table_name set i = i + 1;
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
drop table $table_name;
inc $counter;
}
drop table table_names;
It's hard to see fil in this graph. And it's hard to see the impact of a patch.
Eugene Kosov (Inactive)
added a comment - Flame graph for this test:
create table table_names (
id int primary key auto_increment,
name varchar(255)
) engine=innodb;
insert into table_names values (1, 't1');
let $counter = 1;
while ($counter <= 10000) {
let $id = `select max(id) + 1 from table_names`;
eval
insert into table_names (name) values (concat('t', convert($id, char)));
inc $counter;
}
let $data_size = `select count(*) from table_names`;
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
create table $table_name (i int) engine=innodb;
eval
insert into $table_name values (1), (2), (3), (4), (5);
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
update $table_name set i = i + 1;
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
drop table $table_name;
inc $counter;
}
drop table table_names;
It's hard to see fil in this graph. And it's hard to see the impact of a patch.
I did some additional research, and did not find any evidence that fsync() would not be thread-safe on any POSIX-compliant file system.
Maybe we should consider using the asynchronous I/O interface in the future, that is, IOCB_CMD_FSYNC instead of fsync() or IOCB_CMD_FDSYNC instead of fdatasync().
Marko Mäkelä
added a comment - I did some additional research, and did not find any evidence that fsync() would not be thread-safe on any POSIX-compliant file system.
Maybe we should consider using the asynchronous I/O interface in the future, that is, IOCB_CMD_FSYNC instead of fsync() or IOCB_CMD_FDSYNC instead of fdatasync() .
All functions defined by this volume of IEEE Std 1003.1-2001 shall be thread-safe, except that the following functions1 need not be thread-safe.
Thus, fsync() shall be thread-safe by POSIX.
Eugene Kosov (Inactive)
added a comment - http://pubs.opengroup.org/onlinepubs/007904975/
2.9.1 Thread-Safety
All functions defined by this volume of IEEE Std 1003.1-2001 shall be thread-safe, except that the following functions1 need not be thread-safe.
Thus, fsync() shall be thread-safe by POSIX.
People
Eugene Kosov (Inactive)
Eugene Kosov (Inactive)
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
Flame graph for this test:
create table table_names (
id int primary key auto_increment,
name varchar(255)
) engine=innodb;
insert into table_names values (1, 't1');
let $counter = 1;
while ($counter <= 10000) {
let $id = `select max(id) + 1 from table_names`;
eval
insert into table_names (name) values (concat('t', convert($id, char)));
inc $counter;
}
let $data_size = `select count(*) from table_names`;
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
create table $table_name (i int) engine=innodb;
eval
insert into $table_name values (1), (2), (3), (4), (5);
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
update $table_name set i = i + 1;
inc $counter;
}
let $counter = 1;
while ($counter <= $data_size) {
let $table_name = `select name from table_names where id = $counter`;
eval
drop table $table_name;
inc $counter;
}
drop table table_names;
It's hard to see fil in this graph. And it's hard to see the impact of a patch.