pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: De Leeuw Guy <G.De_Leeuw@eurofer.be>
To: pgsql-admin@postgresql.org
Subject: delayed actions
Date: Tue, 10 Jul 2007 22:53:20 +0200
Message-ID: <4693F1C0.7010502@eurofer.be> (raw)

Hello all

I write a new trigger in C.
These trigger update a sums of rows and I have a strange problem :

when I insert the data ok
When I delete the data the DELETE are delayed and my trigger is fired a
lot of time (see below)
It is possible to flush the actions before exiting my trigger ?

Thanks in advance
Guy

  SPI_connect();
  if bBusy return; /* global variable */

elog(INFO, "Not busy");
     gd_SetBusy(relationName, true);
     gd_InitCatCodes(relationName, tupdesc, retTuple, valDiff, qteDiff,
firedEvent); /* INSERT, DELETE, OR UPGRADE a lot of records */
     gd_SetBusy(relationName, false);
    }
  SPI_finish();
}

db_stats=# INSERT INTO table_f001 VALUES (1, 00000001, 2, 0010101, 3,
00000101, 4, 00004001, 5, 20070199, 0,  50);
INFO:  Not busy
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 101, 4, 4001,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 101, 4, 4099,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 101, 4, 4099,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 1010, 4, 4001,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 1010, 4, 4001,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 1010, 4, 4099,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 1, 2, 10101, 3, 1010, 4, 4099,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 101, 4, 4001,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 101, 4, 4001,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 101, 4, 4099,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 101, 4, 4099,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 1010, 4, 4001,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 1010, 4, 4001,
5, 20079999, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 1010, 4, 4099,
5, 20070199, 0.000000, 50.000000);
INFO:  INSERT INTO table_f001 VALUES (1, 3, 2, 10101, 3, 1010, 4, 4099,
5, 20079999, 0.000000, 50.000000);
db_stats=# DELETE FROM table_f001;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=101 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4001 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=1 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=101 AND code04=4099 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4001 AND code05=20079999;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20070199;
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
INFO:  DELETE FROM table_f001 WHERE code01=3 AND code02=10101 AND
code03=1010 AND code04=4099 AND code05=20079999;
INFO:  Not busy
db_stats=#



view thread (2+ messages)  latest in thread

Message-ID: <4693F1C0.7010502@eurofer.be>
Permalink:  ../4693F1C0.7010502@eurofer.be/
Also on:    postgresql.org/message-id/4693F1C0.7010502@eurofer.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: G.De_Leeuw@eurofer.be
  Subject: Re: delayed actions
  In-Reply-To: <4693F1C0.7010502@eurofer.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox