[Mulgara-dev] 100k models?

Paul Gearon gearon at ieee.org
Thu Apr 5 16:42:52 UTC 2007


On 4/5/07, Laurian Gridinoc <laurian at gmail.com> wrote:
>
> Interesting, and if I have 100k models it will work? I mean how do you do
> it behind the scenes, you iterate all the models (which can be overkill) or
> your indexes are queries independent of a model name constrain?
>

Yes, it will work.  It works the same as if you had 100k subjects, or 100k
predicates, or 100k objects.  Below the abstraction of the query language we
don't actually distinguish between any of these 4 elements.

We have 6 indexes, which we use to find data (using binary searches.  ie.
log(n) complexity).  These indexes are each ordered by (ordered from left to
right):

1. subject predicate object model
2. predicate object subject model
3. object subject predicate model
4. model subject predicate object
5. model predicate object subject
6. model object subject predicate

If you look at this, you'll find that any combination of elements can be
found in one of the above indexed.  For instance, if you have a known
predicate and object (variable subject and model), then you pick index 2.
For a given property in a given model, then you look in index 5.

If you want all the statements from a given model, then you can use indexes
4, 5, or 6.  Finally, if you want ALL statements (all four elements are
variable), or you want to check existence of a given tuple of subject,
predicate, object in a known model, then you can use any of the indexes.

There are actually 6 possible sets of indexes that we could have used, with
no difference.  We like this one, because it preserves the order of
subject/predicate/object in indexes 1 and 4.

Hopefully this shows that each of the elements are being treated completely
symmetrically.  Incidentally, at this level we don't actually care what goes
into any column, meaning that we could have (among other things) literal
subjects, or blank predicates, both of which are illegal in RDF.

Is this useful?

Regards,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mulgara.org/pipermail/mulgara-dev/attachments/20070405/451861a3/attachment.htm>


More information about the Mulgara-dev mailing list