Subject | Re: [firebird-support] What programming languages and toolkits do you use to access Firebird? |
---|---|
Author | Milan Babuskov |
Post date | 2008-10-01T07:52:01Z |
Mercea Paul wrote:
if (inserting)
update tablesrows set table_rows = table_rows + 1;
if (deleting)
update tablesrows set table_rows = table_rows - 1;
would work much faster. However, you'd still get update conflicts
(deadlocks).
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com
> CREATE OR ALTER TRIGGER mytable_COUNTROWS FOR mytableThis looks more like a 'shot in the foot' to me. Something like:
> ACTIVE AFTER INSERT POSITION 0
> AS
> begin
> if (not exists(select 1 from tablesrows t where t.table_name='mytable')
> then
> insert into tablesrows (table_name, table_rows) values ('mytable',1);
>
> update tablesrows set table_rows = (select count(id) from mytable);
> end
if (inserting)
update tablesrows set table_rows = table_rows + 1;
if (deleting)
update tablesrows set table_rows = table_rows - 1;
would work much faster. However, you'd still get update conflicts
(deadlocks).
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com