Is there any way to speed up PL/TCL functions?
I'm using some PL/TCL functions and triggers to do some special inserts. When
I do an insert that uses these procedures, I get the "INSERT xxxxxx 1" response
back immediately, but then there is a pause before the next query is executed.
It appears as if the PL/TCL runs fast but after its finished it has to spend a
significant amount of time cleaning up before the next query can run.
Is this the way it is? Any way to reduce this pause?
--
- Robert
"Robert B. Easter" <reaster@comptechnews.com> writes:
I'm using some PL/TCL functions and triggers to do some special
inserts. When I do an insert that uses these procedures, I get the
"INSERT xxxxxx 1" response back immediately, but then there is a pause
before the next query is executed. It appears as if the PL/TCL runs
fast but after its finished it has to spend a significant amount of
time cleaning up before the next query can run.
That doesn't make any sense as stated, but it might be that your
triggers are "deferred" (execute-at-commit). I believe the INSERT
command response gets sent before transaction commit, so what's
probably really happening is just that your trigger is slow.
Is this the way it is? Any way to reduce this pause?
Hard to say without knowing what your trigger is doing.
regards, tom lane
Hi !
Help me please to alter table with arrays .
The table was created :
create stat (st char(20), stv float[][], str float[][]);
Usualy I add new row as follow:
insert into stat
select '4090903' as st,
'{{0,0,0,0,0,0},{0,0,0,0,0,0}}' as str,
'{{0,0,0,0,0,0},{0,0,0,0,0,0}}' as stv ;
And now I would like to increase the number of colomns of array from
two to tree. What is the way to fulfill these operation?
Thanks .
Igor
igor <igor_kh@mailru.com> writes:
Help me please to alter table with arrays .
And now I would like to increase the number of colomns of array from
two to tree. What is the way to fulfill these operation?
As of 7.0.*, the only way to change the size of an array is to replace
the whole array, ie,
UPDATE table SET arraycol = '{ .... }'
I have recently fixed the array code so that you can enlarge an array
by assigning to an element or slice. For example, given an array with
current dimensions [1:3] you can assign to array[4] (or array[0], or
array[2:7], etc). Restriction: you can't leave "holes" in the array,
so it only works for 1-D arrays. This will appear in 7.1.
regards, tom lane
Hello all,
Forgive my ignorance. I'm trying to understand the RULES in PostgreSQL and
I have several questions. Why the rules if they are not part of SQL92 or
SQL3? Where do they come from? Are they from before the SQL history of
Postgres? Many things that can be done with RULES can be done with
TRIGGERS even where there is no FOR STATEMENT in the CREATE TRIGGER
statement of PostgreSQL. Are the rules in PostgreSQL, mainly, to implement
VIEWS, so they are some kind of intermediate step between the parser and
the optimizer?
TIA, Jesus.