You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Benson Margulies <bi...@gmail.com> on 2011/01/07 16:45:48 UTC

Efficient TDB insertion

Given a computation that creates a moderately large, but not gigantic,
collection of new triples, which do I want:

1) dataset.getNamedModel(graphUri); and add directly to the model.

2) Create a memory model and add the whole thing when I have a batch all set.

?

Re: Efficient TDB insertion

Posted by Andy Seaborne <an...@epimorphics.com>.

On 07/01/11 15:45, Benson Margulies wrote:
> Given a computation that creates a moderately large, but not gigantic,
> collection of new triples, which do I want:
>
> 1) dataset.getNamedModel(graphUri); and add directly to the model.
>
> 2) Create a memory model and add the whole thing when I have a batch all set.
>
> ?

I don;'t know for sure but I doubt it makes much difference currently. 
When the database already has data in it, loading triples/quads is 
slower than the bulk loader can do because it hits all the indexes one 
triple/quad at a time.

If, however , it's an empty database, write the triples as N-triples to
stdout and pipe into the bulk loader.

	Andy