[PERFORM] Trigger is not firing immediately

2008-07-14 Thread Praveen

Hi All,
I am having a trigger in table, If I update the the table manually trigger 
is firing immediately(say 200ms per row), But if I update the table through 
procedure the trigger is taking time to fire(say 7 to 10 seconds per row).

Please tell me what kind of changes can I make so that  trigger  fire 
immediately while updating the table through procedure ?

Regards,
Praveen

Re: [PERFORM] Trigger is not firing immediately

2008-07-14 Thread A. Kretschmer
am  Mon, dem 14.07.2008, um 12:04:49 +0530 mailte Praveen folgendes:
  
 Hi All,
 I am having a trigger in table, If I update the the table manually trigger
 is firing immediately(say 200ms per row), But if I update the table through
 procedure the trigger is taking time to fire(say 7 to 10 seconds per row).
  
 Please tell me what kind of changes can I make so that  trigger  fire
 immediately while updating the table through procedure ?

Show us more details like source-code of the procedure, the trigger and
a demonstration.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Trigger is not firing immediately

2008-07-14 Thread Chris
Praveen wrote:
  
 Hi All,
 I am having a trigger in table, If I update the the table manually
 trigger is firing immediately(say 200ms per row), But if I update the
 table through procedure the trigger is taking time to fire(say 7 to 10
 seconds per row).
  
 Please tell me what kind of changes can I make so that  trigger  fire
 immediately while updating the table through procedure ?

Sending the same email over and over again isn't going to get you a
response any quicker.

If you send the details of the trigger and the tables/fields it affects
then you might get a more helpful response.

-- 
Postgresql  php tutorials
http://www.designmagick.com/

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Trigger is not firing immediately

2008-07-14 Thread Praveen


Hi all,
   Please find the procedure and trigger which took more time when we try 
to update value in table through Procedure.


CREATE OR REPLACE FUNCTION procname1(args)
 RETURNS void AS
$BODY$
DECLARE
{
---
Some code blocks
---
}
BEGIN

--  to here it is executing fastly after reaches this statement it's 
taking  time



update table1 set col1 = val1 where pk = val2 and col2 = val3;


- HERE table1  IS HAVING THE TRIGGER I GIVEN BELOW THE TRIGGER( 
trigger1)



exception
WHEN OTHERS
 THEN
  raise notice '''EXCEPTION IN procname1 BLOCK 3 : %''',SQLERRM;
 NULL;
END; $BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION procname1(args);




CREATE OR REPLACE FUNCTION trigger1()
 RETURNS trigger AS
$BODY$
BEGIN

IF (TG_OP='UPDATE') THEN
IF( some condition )
 THEN
  BEGIN
   INSERT INTO table2(cols)
   VALUES(values);
  IF NOT FOUND THEN
  NULL;
  END IF;
 EXCEPTION
   WHEN OTHERS
 THEN
  NULL;
  END;
 END IF;
END IF;
RETURN NULL;
END; $BODY$
 LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION trigger1();


- Original Message - 
From: A. Kretschmer [EMAIL PROTECTED]

To: pgsql-performance@postgresql.org
Sent: Monday, July 14, 2008 12:18 PM
Subject: Re: [PERFORM] Trigger is not firing immediately



am  Mon, dem 14.07.2008, um 12:04:49 +0530 mailte Praveen folgendes:


Hi All,
I am having a trigger in table, If I update the the table manually 
trigger
is firing immediately(say 200ms per row), But if I update the table 
through
procedure the trigger is taking time to fire(say 7 to 10 seconds per 
row).


Please tell me what kind of changes can I make so that  trigger  fire
immediately while updating the table through procedure ?


Show us more details like source-code of the procedure, the trigger and
a demonstration.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

--
Sent via pgsql-performance mailing list 
(pgsql-performance@postgresql.org)

To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance









--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Trigger is not firing immediately

2008-07-14 Thread Pavel Stehule
hello

Are you sure, so you don't call trigger recursion?

Regards
Pavel Stehule

2008/7/14 Praveen [EMAIL PROTECTED]:

 Hi all,
   Please find the procedure and trigger which took more time when we try to
 update value in table through Procedure.

 CREATE OR REPLACE FUNCTION procname1(args)
  RETURNS void AS
 $BODY$
 DECLARE
 {
 ---
 Some code blocks
 ---
 }
 BEGIN

 --  to here it is executing fastly after reaches this statement it's
 taking  time


 update table1 set col1 = val1 where pk = val2 and col2 = val3;


 - HERE table1  IS HAVING THE TRIGGER I GIVEN BELOW THE TRIGGER(
 trigger1)


 exception
 WHEN OTHERS
  THEN
  raise notice '''EXCEPTION IN procname1 BLOCK 3 : %''',SQLERRM;
  NULL;
 END; $BODY$
 LANGUAGE 'plpgsql' VOLATILE;
 ALTER FUNCTION procname1(args);




 CREATE OR REPLACE FUNCTION trigger1()
  RETURNS trigger AS
 $BODY$
 BEGIN

 IF (TG_OP='UPDATE') THEN
 IF( some condition )
  THEN
  BEGIN
   INSERT INTO table2(cols)
   VALUES(values);
  IF NOT FOUND THEN
  NULL;
  END IF;
  EXCEPTION
   WHEN OTHERS
  THEN
  NULL;
  END;
  END IF;
 END IF;
 RETURN NULL;
 END; $BODY$
  LANGUAGE 'plpgsql' VOLATILE;
 ALTER FUNCTION trigger1();


 - Original Message - From: A. Kretschmer
 [EMAIL PROTECTED]
 To: pgsql-performance@postgresql.org
 Sent: Monday, July 14, 2008 12:18 PM
 Subject: Re: [PERFORM] Trigger is not firing immediately


 am  Mon, dem 14.07.2008, um 12:04:49 +0530 mailte Praveen folgendes:

 Hi All,
I am having a trigger in table, If I update the the table manually
 trigger
 is firing immediately(say 200ms per row), But if I update the table
 through
 procedure the trigger is taking time to fire(say 7 to 10 seconds per
 row).

 Please tell me what kind of changes can I make so that  trigger  fire
 immediately while updating the table through procedure ?

 Show us more details like source-code of the procedure, the trigger and
 a demonstration.


 Andreas
 --
 Andreas Kretschmer
 Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
 GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

 --
 Sent via pgsql-performance mailing list
 (pgsql-performance@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-performance







 --
 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-performance


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Trigger is not firing immediately

2008-07-14 Thread Praveen

Yes , I am sure it is not trigger recursion.
- Original Message - 
From: Pavel Stehule [EMAIL PROTECTED]

To: Praveen [EMAIL PROTECTED]
Cc: pgsql-performance@postgresql.org; [EMAIL PROTECTED]
Sent: Monday, July 14, 2008 3:03 PM
Subject: Re: [PERFORM] Trigger is not firing immediately



hello

Are you sure, so you don't call trigger recursion?

Regards
Pavel Stehule

2008/7/14 Praveen [EMAIL PROTECTED]:


Hi all,
  Please find the procedure and trigger which took more time when we try 
to

update value in table through Procedure.

CREATE OR REPLACE FUNCTION procname1(args)
 RETURNS void AS
$BODY$
DECLARE
{
---
Some code blocks
---
}
BEGIN

--  to here it is executing fastly after reaches this statement it's
taking  time


update table1 set col1 = val1 where pk = val2 and col2 = val3;


- HERE table1  IS HAVING THE TRIGGER I GIVEN BELOW THE TRIGGER(
trigger1)


exception
WHEN OTHERS
 THEN
 raise notice '''EXCEPTION IN procname1 BLOCK 3 : %''',SQLERRM;
 NULL;
END; $BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION procname1(args);




CREATE OR REPLACE FUNCTION trigger1()
 RETURNS trigger AS
$BODY$
BEGIN

IF (TG_OP='UPDATE') THEN
IF( some condition )
 THEN
 BEGIN
  INSERT INTO table2(cols)
  VALUES(values);
 IF NOT FOUND THEN
 NULL;
 END IF;
 EXCEPTION
  WHEN OTHERS
 THEN
 NULL;
 END;
 END IF;
END IF;
RETURN NULL;
END; $BODY$
 LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION trigger1();



- Original Message - From: A. Kretschmer
[EMAIL PROTECTED]
To: pgsql-performance@postgresql.org
Sent: Monday, July 14, 2008 12:18 PM
Subject: Re: [PERFORM] Trigger is not firing immediately



am  Mon, dem 14.07.2008, um 12:04:49 +0530 mailte Praveen folgendes:


Hi All,
   I am having a trigger in table, If I update the the table manually
trigger
is firing immediately(say 200ms per row), But if I update the table
through
procedure the trigger is taking time to fire(say 7 to 10 seconds per
row).

Please tell me what kind of changes can I make so that  trigger  fire
immediately while updating the table through procedure ?


Show us more details like source-code of the procedure, the trigger and
a demonstration.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: - Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

--
Sent via pgsql-performance mailing list
(pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance









--
Sent via pgsql-performance mailing list 
(pgsql-performance@postgresql.org)

To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance







--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] [QUESTION]Concurrent Access

2008-07-14 Thread Leví Teodoro da Silva
Hi guys !!!

Sorry for the wrong spelling. =)
I could see that PostgreSQL will support my application, but i have to do a
good configuration on my server.

Thanks for answers, now i will look for informations about PostgreSQL on
OpenSolaris 2008.05
Have a nice week,
Levi


2008/7/4 Chris Browne [EMAIL PROTECTED]:

 [EMAIL PROTECTED] (Leví Teodoro da Silva) writes:
  Hi guys, How are you ?
  I am from Brazil and i work for a little company and it company is
 working is medium-big project and we want to use PostGree like the DataBase
  system, but i got some questions.
  I want to know if the PostGree has limitations about the concurrent
 access, because a lot of people will access this database at the same time.
  I want to know about the limitations, like how much memory do i have to
 use !? How big could be my database and how simultaneously access this
  database support ?

 PostGree is a system I am not familiar with; this list is for
 discussion of PostgreSQL, sometimes aliased as Postgres, so I will
 assume you are referring instead to PostgreSQL.

 PostgreSQL does have limitations; each connection spawns a process,
 and makes use of its own work_mem, which has the result that the
 more connections you configure a particular backend to support, the
 more memory that will consume, and eventually your system will
 presumably run out of memory.

 The size of the database doesn't have as much to do with how many
 users you can support as does the configuration that you set up.
 --
 select 'cbbrowne' || '@' || 'linuxfinances.info';
 http://cbbrowne.com/info/lsf.html
 Rules  of the  Evil Overlord  #145. My  dungeon cell  decor  will not
 feature exposed pipes.  While they add to the  gloomy atmosphere, they
 are good  conductors of vibrations and  a lot of  prisoners know Morse
 code. http://www.eviloverlord.com/

 --
 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-performance



Re: [PERFORM] Trigger is taking time to fire

2008-07-14 Thread Scott Marlowe
On Sun, Jul 13, 2008 at 11:59 PM, Ramasubramanian
[EMAIL PROTECTED] wrote:

 Hi All,
 I am having a trigger in table, If i update the the table manually it is
 not taking time(say 200ms per row), But if i update the table through
 procedure the trigger is taking time to fire(say 7 to 10 seconds per row).

 How can i make the trigger to fire immediately ?

I'm thinking the user defined function is using a cached query plan.
Try using execute to see if it runs faster that way.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] 3ware vs Areca

2008-07-14 Thread Greg Smith

On Fri, 11 Jul 2008, Jeffrey Baker wrote:


Their firmware is, frankly, garbage.  In more than one instance we
have had the card panic when a disk fails, which is obviously counter
to the entire purpose of a RAID.  We finally removed the Areca
controllers from our database server and replaced them with HP P800s.


Can you give a bit more detail here?  If what you mean is that the driver 
for the card generated an OS panic when a drive failed, that's not 
necessarily the firmware at all.  I know I had problems with the Areca 
cards under Linux until their driver went into the mainline kernel in 
2.6.19, all kinds of panics under normal conditions.  Haven't seen 
anything like that with later Linux kernels or under Solaris 10, but then 
again I haven't had a disk failure yet either.


--
* Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance