Subject | Re: What programming languages and toolkits do you use to access Firebird? |
---|---|
Author | tomkrej |
Post date | 2008-10-02T06:46:45Z |
>table and
> How about letting the system tables reflect the base version of the
> put the per-transaction row-count toghether with theversion-specific data of
> the table ?I think this is very crazy idea, because each user has it's own
>
> Thank you,
> Timothy Madden
>
specific requierements and if You add all of them into system tables,
you don't need a database.
If You need to know how many records(rows) you have in tables, You can
use this easy trick that I see on one session by Ivan Prenosil.
You have table MY_TABLE with very high number of rows (in other cases
it has no sense)
You create MY_TABLE_CNT (cnt integer);
on table MY_TABLE you define after insert trigger - insert into
MY_TABLE_CNT values (1);
on table MY_TABLE you define after delete trigger - insert into
MY_TABLE_CNT values (-1);
if you want to know how many rows are in MY_TABLE, you only do
select sum(cnt) from MY_TABLE_CNT;
The trick is that You can in some interval run procedure that
run this select (sum)
save the result
delete whole MY_TABLE_CNT
and inserts result of sum
Tom