Re: [GENERAL] Decrease the time required function

2013-02-08 Thread Kevin Grittner
Albe Laurenz wrote: > Karel Riverón wrote: >> I have a PL/pgSQL function that it takes 4 seconds to execute. >> OPEN casos_reales; >> LOOP FETCH casos_reales into cr; > [...] >> OPEN criterios; >> LOOP FETCH criterios into c; > [...] >> SELECT c_r_c.id, valor INTO crc >>

Re: [GENERAL] Decrease the time required function

2013-02-08 Thread Albe Laurenz
Karel Riverón wrote: > I have a PL/pgSQL function that it takes 4 seconds to execute. This is my > function: > > CREATE OR REPLACE FUNCTION listarcasosrecuperados(escenario_id integer) > RETURNS SETOF caso_real AS [...] > OPEN criterios; > LOOP FETCH criterios into c; > IF NOT FOUND THEN >

[GENERAL] Decrease the time required function

2013-02-08 Thread Karel Riverón
Hi everyone, I have a PL/pgSQL function that it takes 4 seconds to execute. This is my function: CREATE OR REPLACE FUNCTION listarcasosrecuperados(escenario_id integer) RETURNS SETOF caso_real AS $BODY$ DECLARE criterios CURSOR FOR SELECT * FROM criterio; casos_reales CURSOR FOR S