In a particular RDF Store Benchmarks there is difference if the queries are executed with specified graph or with specified multiple graphs. As Virtuoso is quad store, not triple store with many tables, it runs queries inefficiently if graphs are specified and there are no additional indexes except pre-set GSPO and OGPS. Proper use of the FROM clause or adding indexes with graph column will contribute for better results.

If is known in advance for the current RDF Store Benchmarks that some users will not indicate specific graphs then should be done:

  • either create indexes with graph in last position

  • or load everything into single graph and specify it somewhere in querying application.

Both methods do not require any changes in query texts

  • For users using Virtuoso 5 is strongly recommended is the usage of additional bitmap indexes:

    SQL> create bitmap index RDF_QUAD_POGS on DB.DBA.RDF_QUAD (P,O,G,S);
    SQL> create bitmap index RDF_QUAD_PSOG on DB.DBA.RDF_QUAD (P,S,O,G);
  • For users using Virtuoso 6 or higher, see the new layout here .

You can create other indexes as well. Bitmap indexes are preferable, but if O is the last column, then the index can not be bitmap, so it could be, for e.g.:

create index RDF_QUAD_PSGO on DB.DBA.RDF_QUAD (P, S, G, O);

but cannot be:

create bitmap index RDF_QUAD_PSGO on DB.DBA.RDF_QUAD (P, S, G, O);