create table test ( a int, b varchar(20));
create index test_b on test(b);
-- 
--
create function fill_table () returns int as '
declare
  i int4;
begin
  for i in 1..1000 loop
    insert into test values( i, ''Line ''||i );
  end loop;
  return 1;
end;
' language 'plpgsql';
--
--
select fill_table();
--
--
vacuum verbose analyze test;
--
--
select * from test where b like 'Line 99%';
select * from test where b like 'Line %';

