I've made a test. Here is a innodb table:
CREATE TABLE `test_UNIX_TIMESTAMP` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`datefrom` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
Here is an insert:
insert into test_UNIX_TIMESTAMP (datefrom) values
(UNIX_TIMESTAMP())
,(UNIX_TIMESTAMP())
,(UNIX_TIMESTAMP())
....many many
,(UNIX_TIMESTAMP());
Here is a query to check is it unique timestamps or not:
select distinct(datefrom) from test_UNIX_TIMESTAMP;
The results are:
After Affected rows: 106 400, we have 1 unique timestamp value in the table.
After Affected rows: 1 170 400 , we still have 1 unique timestamp value in the table.
MySQL server - it's remote SQL server (xeon 1270v3 with 32 ram, mysql have 4Gb cache).
Is "UNIX_TIMESTAMP()" value fixed for large insert queries? Or it's fixed for session? Or i'm just lucky?