[Xapian-tickets] [Xapian] #491: calling replace_document() twice doubles the size of the database
Xapian
nobody at xapian.org
Thu Jul 1 02:57:56 BST 2010
#491: calling replace_document() twice doubles the size of the database
--------------------+-------------------------------------------------------
Reporter: maad | Owner: olly
Type: defect | Status: closed
Priority: normal | Milestone:
Component: Other | Version:
Severity: major | Resolution: invalid
Keywords: | Blockedby:
Platform: All | Blocking:
--------------------+-------------------------------------------------------
Comment(by olly):
We do actually check that. But to commit the table, we need a new root
block. So if you replace a million documents with themselves, you should
see the table sizes increase by a single block (8KB by default). So it's
only "doubles the size" if your database tables are only 8KB to start
with.
The new Btree manager I'm working on (see browser:branches/brass-btree for
the code) reuses the existing root block in this case.
It would be nice to reuse the root block in the current backends too, but
when I looked briefly at trying to avoid committing unmodified tables some
years ago, the obvious simple change didn't worked, so I think somewhere
assumes that the revision number stored in the root block is that of the
latest revision.
If you want to work on a patch to achieve this for the current chert
backend, feel free - chert_table.cc and chert_database.cc are the files to
look at. If the patch looks sane and the test coverage for it is good, I
would support applying it.
--
Ticket URL: <http://trac.xapian.org/ticket/491#comment:3>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list