replace value vs. insert node
Hi,
in terms of performance, is it cheaper to update the value of an existing node or to insert a node with that value?
I'm not sure if I should create empty nodes or nodes with a default-value in the first place and when users specify values these nodes will be updated. Or if I insert nodes with these values when users specify them in the web interface. Values are short texts like "yes" or "no".
The value of the one node I have to update in any case is a longer text with some markup in it (for highlighting purposes of single tokens).
UPDINDEX for the DB is set and I will have to optimize the index after each user interaction, because I need the fulltext index in the next interaction. So the options are actually these:
- insert 6 nodes, replace value of 1 node, optimize - replace values of 7 nodes, optimize
Thanks in advance and best regards
Cerstin
Hi Cerstin,
a short one: value updates are indeed cheaper than structural updates (deletes and inserts).
Cheers, Christian
Quoted text · Cerstin Elisabeth Mahlow · 37 lines
On Fri, Mar 22, 2013 at 8:26 PM, Cerstin Elisabeth Mahlow <cerstin.mahlow at unibas.ch> wrote: > Hi, > > in terms of performance, is it cheaper to update the value of an existing node or to insert a node with that value? > > I'm not sure if I should create empty nodes or nodes with a default-value in the first place and when users specify values these nodes will be updated. Or if I insert nodes with these values when users specify them in the web interface. Values are short texts like "yes" or "no". > > The value of the one node I have to update in any case is a longer text with some markup in it (for highlighting purposes of single tokens). > > UPDINDEX for the DB is set and I will have to optimize the index after each user interaction, because I need the fulltext index in the next interaction. So the options are actually these: > > - insert 6 nodes, replace value of 1 node, optimize > - replace values of 7 nodes, optimize > > Thanks in advance and best regards > > Cerstin > -- > Dr. phil. Cerstin Mahlow > > Universität Basel > Departement Sprach- und Literaturwissenschaften > Fachbereich Deutsche Sprach- und Literaturwissenschaft > Nadelberg 4 > 4051 Basel > Schweiz > > Tel: +41 61 267 07 65 > Fax: +41 61 267 34 40 > Mail: cerstin.mahlow at unibas.ch > Web: http://www.oldphras.net > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.