Re: 100% CPU at concurent access

Поиск
Список
Период
Сортировка
От Sabin Coanda
Тема Re: 100% CPU at concurent access
Дата
Msg-id gcne3o$1l0t$1@news.hub.org
обсуждение исходный текст
Ответ на 100% CPU at concurent access  ("Sabin Coanda" <sabin.coanda@deuromedia.ro>)
Список pgsql-sql
I find the problem is in my outer procedure, because it has no sleep there, 
and I change it calling pg_sleep:

-- Function: "TestProcOuter"()

-- DROP FUNCTION "TestProcOuter"();

CREATE OR REPLACE FUNCTION "TestProcOuter"() RETURNS integer AS
$BODY$
DECLARE       Loops int4 := 1;
BEGIN       LOOP               RAISE NOTICE 'TestProcOuter: % loop', Loops;               IF 0 = "TestProcInner"() THEN
                     EXIT; -- LOOP               END IF;               Loops = Loops + 1;               PERFORM
pg_sleep(4);      END LOOP;
 
       RETURN 0;
END;
$BODY$ LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION "TestProcOuter"() OWNER TO postgres;

With this change, I found the first session succeeds, the CPU is not rised 
anymore, but the second session doesn't succeed even after the first one 
finish successfully.

It fails forever.

Why ? What have I make to succeed ?

TIA,
Sabin 




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Bart Degryse"
Дата:
Сообщение: Re: trigger parameters, what am I doing wrong ??
Следующее
От: Gerardo Herzig
Дата:
Сообщение: replicating a table in several databases