Subject | Re: Implement maximum database size |
---|---|
Author | Branimir Trumbic |
Post date | 2007-12-20T13:33:16Z |
> It is possible to retrieve the PageSize and AllocatedPages. I don'tcrude.
> know how, but if you run IB_SQL and look at the "Characteristics"
> pane after connecting to a database you can see these values. You
> might consider refusing to insert new records after
> PageSize*AllocatedPages exceeds some value, although this is pretty
> It is probably better to occasionally count the number of records inAfter long discussion me and my colleagues accepted solution with one
> a few "important" tables, and use this as the limiting criteria.
>
> --
> Aage J.
>
SUM field in separate table. This SUM field will contain sums of all
important blob fields in database (probably 4-5 of them). User will
not be able to temper with this field as he has no database access
(our server hosting).
SUM field will be updated (trough triggers) with SQL expression which
(I hope) qurantee safe locking):
UPDATE SUM_TABLE SET SUM_FIELD=SUM_FIELD+AddedSize;
Normally, database will be used by few users (5-10) so concurrency
will not be issue.
I'm just wondering is this better option then to sum all blob fields
before user inserts new data. This SQL works pretty fast for one table
with couple hundred blob fields filled with data:
SELECT sum(octet_length(BLOB_FIELD)) FROM MY_TABLE