
create table sort_test (
	v1 varchar, v2 varchar, v3 varchar, v4 varchar, v5 varchar,
	v6 varchar, v7 varchar, v8 varchar, v9 varchar, v10 varchar);

create function make_test_data(integer) returns integer
as '
declare
	cnt	alias for $1;
	i	integer := 0;
	z	integer := 0;
begin
	loop
		i := i + 1;
		if i >= cnt then
			exit;
		end if;

		insert into sort_test values(
			round(random() * 10), round(random() * 10),
			round(random() * 10), round(random() * 10),
			round(random() * 10), round(random() * 10),
			round(random() * 10), round(random() * 10),
			round(random() * 10), round(random() * 10));
	end loop;

	return i;
end;
'
language 'plpgsql';

select make_test_data(100000);

