--CREATE DATABASE korean WITH ENCODING 'EUC_KR' LC_COLLATE='ko_KR.EUC-KR' LC_CTYPE='ko_KR.EUC-KR' TEMPLATE=template0;

-- CREATE FUNCTION benchmark_textpos(text, text, int4) RETURNS int4 AS '/home/heikki/git-sandbox/postgresql/src/test/regress/regress.so', 'benchmark_textpos' LANGUAGE C;

\timing on

SELECT benchmark_textpos(rpad('',         1000, '완')||'성', rpad('',   1, '성'), 1000000);

SELECT benchmark_textpos(rpad('',    1000*1000, '완')||rpad('',  50, '성'), rpad('',  50, '성'), 1000);

SELECT benchmark_textpos(rpad('', 80*1000*1000, '완')||rpad('', 250, '성'), rpad('', 250, '성'), 10);

\timing off
