Subject | DB always growing |
---|---|
Author | Fabrice Aeschbacher |
Post date | 2003-05-07T16:59:03Z |
Hi,
Firebird version: LI-V6.2.908 Firebird 1.0 (classic-64)
OS: Linux/debian kernel 2.4.20
File system: XFS
I want to store video data from a video stream in a database
CREATE TABLE VIDEO (
VIDEO_ID INTEGER NOT NULL
, TS TIMESTAMP
, VIDEO_DATA BLOB( 65535, 0 )
, VIDEO_SIZE INTEGER
, CONSTRAINT PK_VIDEO PRIMARY KEY ( VIDEO_ID )
)
A first process keeps reading the video stream and inserting the data
into the db (I make a new record for each 10Mo read from the video
stream). I commit the transaction after each insert. Works fine, I am
able then to re-read the video stream and play it with any media player.
A second process loops deleting the old records:
DELETE FROM VIDEO WHERE (CURRENT_TIMESTAMP - TS) > some_value.
It works fine too, I am able to see that the records older than (say)
15 minutes are deleted; for example, SELECT SUM(VIDEO_SIZE) FROM VIDEO
does not move much, giving back values between 500Mo and 1 Go.
The problem is, the size of the database does not stop growing.
The size of the db itself is now > 5 Go and is increasing.
Is the space used by deleted blobs never freed?
How could I avoid that the DB is going to big ?
Thanks,
Fabrice aeschbacher
Firebird version: LI-V6.2.908 Firebird 1.0 (classic-64)
OS: Linux/debian kernel 2.4.20
File system: XFS
I want to store video data from a video stream in a database
CREATE TABLE VIDEO (
VIDEO_ID INTEGER NOT NULL
, TS TIMESTAMP
, VIDEO_DATA BLOB( 65535, 0 )
, VIDEO_SIZE INTEGER
, CONSTRAINT PK_VIDEO PRIMARY KEY ( VIDEO_ID )
)
A first process keeps reading the video stream and inserting the data
into the db (I make a new record for each 10Mo read from the video
stream). I commit the transaction after each insert. Works fine, I am
able then to re-read the video stream and play it with any media player.
A second process loops deleting the old records:
DELETE FROM VIDEO WHERE (CURRENT_TIMESTAMP - TS) > some_value.
It works fine too, I am able to see that the records older than (say)
15 minutes are deleted; for example, SELECT SUM(VIDEO_SIZE) FROM VIDEO
does not move much, giving back values between 500Mo and 1 Go.
The problem is, the size of the database does not stop growing.
The size of the db itself is now > 5 Go and is increasing.
Is the space used by deleted blobs never freed?
How could I avoid that the DB is going to big ?
Thanks,
Fabrice aeschbacher