-- Setup
-- SELECT setseed(0);
-- CREATE TABLE t (c) AS
-- SELECT chr(1 + (random() * 65534)::int) FROM generate_series(1,10000000) gen(n);

-- NOTE: due to concurrent load, timings typically varied 1-2s between runs.

-- en_US.UTF8, unpatched: 68.75s
-- en_US.UTF8,   patched: 67.95s
-- id_ID.UTF8, unpatched: 67.48s
-- id_ID.UTF8,   patched: 69.34s
SELECT min(c)

-- en_US.UTF8,   patched: 81.59s
-- id_ID.UTF8,   patched: 84.59s
--SELECT min(c COLLATE "id_ID")

FROM (
	SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
	UNION ALL SELECT c FROM t
) t_all;
