\timing
drop database if exists testing;

CREATE DATABASE testing;
\c testing

CREATE TABLE ar(a text[][]);

INSERT INTO ar
VALUES('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[]),
('{{hoho1,hoho2,hoho3},{hoho4,hoho5,hohohohohohohohoho6},{hoho7,hohoo8,9ohoh}}'::text[])
;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;
insert into ar select * from ar;

create temporary table res(length int);

insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
insert into res select length(array_agg(a)::text) from ar, generate_series(1,10);
