Hi Gerard,
Is it possible that your database file size is close to your cache
size? That would explain why small changes make a big difference to
performance, and also why a dump/load improves things (it will compact
the database so that it fits in cache again).
If that doesn't sound likely, can you tell where the time is being
spent? Is the system running at 100% CPU for those 10 seconds, or is
it I/O bound? Does switching off log flushing (with the DB_TXN_NOSYNC
flag to DB_ENV->set_flags) improve performance?
Quote:
P.S. It would also be nice to have a db_reload utility that did the
db_dump/db_load in one safe application. |
This isn't something that applications should normally have to do.
There is a benefit of compacting the database, if keys were inserted
out-of-order, but that's usually an off-line operation. Also note that
db_load will use transactions if the environment is configured for
them, so it is safe in that sense.
The next release of Berkeley DB will have support for on-line
compaction, so that databases can be compacted without requiring a
dump/load.
Regards,
Michael.