Re: [SQL] overload

2011-07-08 Thread lists-pgsql
I'm have the same situation with large tables. Take a look at using a cursor to fetch several thousand rows at a time. I presume what's happening is that perl is attempting to create a massive list/array in memory. If you use a cursor the list should only contain X number of rows where X in the

Re: [SQL] overload

2011-07-08 Thread Viktor Bojović
Thanx Wayne, at the end i did it that way and it works. The code is below. CREATE FUNCTION pattern_counter1(patLength integer) RETURNS character varying LANGUAGE plperl AS $_X$ my $rvCnt = spi_exec_query(select count(1) as cnt from entry); #my $rowCountAll = $rvCnt-{processed}; my $row =

Re: [SQL] overload

2011-07-08 Thread lists-pgsql
Hi Viktor, I'm not sure what your requirements are in terms of performance and stability of the your result set. See Pavel's response. A cursor issues a single query and renders a single result set. The result set is static, the cursor just gives you finer control/performance when retrieving rows