Opened 14 years ago

Last modified 13 months ago

#429 new enhancement

Document should perhaps track changes directly

Reported by: Olly Betts Owned by: Olly Betts
Priority: normal Milestone: 2.0.0
Component: Backend-Glass Version: git master
Severity: normal Keywords:
Cc: Blocked By:
Blocking: #302 Operating System: All

Description

Follow on from #250.

I wonder if a Document object should track the changes made, rather than copy the old data and modify it. Currently adding a new term to a document is unnecessarily O(number of terms indexing that document). The current optimisation is still useful in the case of reindexing an unmodified (or slightly modified) document from the original source.

Allowing iteration of the modified data is awkward - either we need specialised iterator subclasses to handle this, or we flatten the changes onto the old data to give the current representation when asked to iterate.

Marking for 1.2.x as this probably doesn't require ABI or API changes.

Change History (6)

comment:1 by Olly Betts, 12 years ago

Milestone: 1.2.x1.3.x

comment:2 by Olly Betts, 9 years ago

Component: Backend-BrassBackend-Glass

comment:3 by Olly Betts, 8 years ago

Milestone: 1.3.x1.4.x

Not a blocker for 1.4.0.

comment:4 by Olly Betts, 6 years ago

The "adding a single term" case will need to rewrite the termlist table entry, which I think means this is inevitably O(number of terms indexing that document) (at least until we support replace_document() on termlist-less databases).

It may still be significantly faster despite that unchanged O() though.

comment:5 by Olly Betts, 19 months ago

Blocking: 302 added

comment:6 by Olly Betts, 13 months ago

Milestone: 1.4.x2.0.0
Version: SVN trunkgit master
Note: See TracTickets for help on using tickets.