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

\timing on

DO $$
BEGIN
  FOR i IN 1..1000000 LOOP
    PERFORM position(rpad('',   1, '성') in rpad('',         1000, '완')||'성');
  END LOOP;
END;
$$;

DO $$
BEGIN
  FOR i IN 1..1000000 LOOP
    PERFORM position(rpad('',  50, '성') in rpad('',    1000*1000, '완')||rpad('',  50, '성'));
  END LOOP;
END;
$$;

DO $$
BEGIN
    PERFORM position(rpad('', 250, '성') in rpad('', 80*1000*1000, '완')||rpad('', 250, '성'));
END;
$$;

\timing off
