Re: [SQL] overload

2011-07-11 Thread Viktor Bojović
Thanx Wayne and Pavel, i will try to make this work with cursors. Theoretically there can be more than 4 bilion records in result, but only 58mil returned which took 3 days. Possibly i will have to create temporary table and store results form %patterns into it after each 500k records, and group

Re: [SQL] overload

2011-07-11 Thread Viktor Bojović
I have found cursors example in plperl. now it works fine. the code is below. CREATE OR REPLACE FUNCTION uniprot_frekvencije.pattern_counter2(patLength integer) RETURNS character varying AS $BODY$ my $sth = spi_query(select sequence from entry); my $patLen = $_[0]; my $patt = '';