dba_delete() problems
am 02.06.2002 10:06:31 von Steve Gerhardt
Hello all,
I've got a bit of a problem at the moment. I'm using the dba_ functions to
do some simple database access, and I have the need to delete some items
from the database from time to time. When dba_delete() is called, it returns
true, indicating that the key/value pair was deleted. After making the
deletions, dba_sync() is called. The problem is, the database size never
decreases no matter how much you delete (even if you remove every item). On
examination of the .dbm files in text editor, I found that all the data from
every key/value pair was still there, and hadn't been removed as I wanted it
to. This is extremely bad for the database, because it grows constantly with
no way to decrease the size other than flat out deleting it, which I don't
want to do. Am I doing something wrong with deleting the keys, or is this an
issue with dba?
Notes: I'm using Apache 1.3.24 and PHP 4.2.1 on Windows XP Professional. The
database is accessed using the db3 handler.
Thank you in advance for any replies,
Steve
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: dba_delete() problems
am 04.06.2002 08:38:36 von David Robley
In article <20020602080642.61605.qmail@pb1.pair.com>,
oceanwave@linkline.com says...
> Hello all,
>
> I've got a bit of a problem at the moment. I'm using the dba_ functions to
> do some simple database access, and I have the need to delete some items
> from the database from time to time. When dba_delete() is called, it returns
> true, indicating that the key/value pair was deleted. After making the
> deletions, dba_sync() is called. The problem is, the database size never
> decreases no matter how much you delete (even if you remove every item). On
> examination of the .dbm files in text editor, I found that all the data from
> every key/value pair was still there, and hadn't been removed as I wanted it
> to. This is extremely bad for the database, because it grows constantly with
> no way to decrease the size other than flat out deleting it, which I don't
> want to do. Am I doing something wrong with deleting the keys, or is this an
> issue with dba?
>
> Notes: I'm using Apache 1.3.24 and PHP 4.2.1 on Windows XP Professional. The
> database is accessed using the db3 handler.
>
> Thank you in advance for any replies,
> Steve
I don't know ththe Berlely style db app, but what does dba_optimize do?
That may be analogous to DBase's Pack function which tidies up empty
entries?
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php