My latest quiz was quite popular, and some interesting
ideas were submitted.
There was an interesting development. A colleague called and
asked me for advice on how to insert 4 billion rows in a table
with a simple structure.
create table t1 (
id tinyint not null
);
Very simple. No primary key, no indexes. It is needed to perform
some specific tests.
Actually, not 4 billion, but 2^32 records are needed, i.e.
4,294,967,296.
The classical method used in these cases is doubling the table
contents:
insert into t1 values (1),(1),(1),(1),(1),(1),(1),(1);
insert into t1 select * from t1;
insert into t1 select * from t1; # and so on
My solution was similar to the one from my quiz.
CREATE VIEW `v4` …[Read more]