Sebastian,

What indexes are in use? It seems to me that only default indexes are
created, but patterns with unspecified graph need, of course, two
additional indexes. If the speed of the first query is suitable and you
do not want to create additional indexes for some reason, consider 

select * where {
     graph ?commonGraph {
         ?r a nfo:FileDataObject .
         ?r nie:isPartOf ?f . }
     OPTIONAL { ?g <http://www.strigi.org/fields#indexGraphFor> ?r . } .  
     FILTER(!BOUND(?g)) .
}

if the modification is acceptable.

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com


On Tue, 2009-10-27 at 12:44 +0100, Sebastian Trüg wrote:
> Just out of curiosity:
> why is there such a big difference in performance between the following 2 
> query variants (second one much slower than the first)
> 
> select * where {
>      ?r a nfo:FileDataObject . 
>      OPTIONAL { ?g <http://www.strigi.org/fields#indexGraphFor> ?r . } .      
>      FILTER(!BOUND(?g)) .
> }
> 
> 
> select * where {
>      ?r a nfo:FileDataObject .
>      ?r nie:isPartOf ?f .
>      OPTIONAL { ?g <http://www.strigi.org/fields#indexGraphFor> ?r . } .  
>      FILTER(!BOUND(?g)) .
> }
> 
> The only difference is one more graph pattern.
> 
> This is Virtuoso 5.0.12 with 
> 
> [Parameters]
> LiteMode=1
> ServerPort=1120
> DisableTcpSocket=1
> PrefixResultNames=0
> ServerThreads=100
> CheckpointInterval=10
> NumberOfBuffers=10000
> MaxDirtyBuffers=50
> SchedulerInterval=5
> FreeTextBatchSize=1000
> 
> Cheers,
> Sebastian Trüg
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Reply via email to