Hello Hugh,

Please find the output attached to prevent line breaks.

Cheers,
Sebastian

On 04/30/2010 03:14 AM, Hugh Williams wrote:
> Hi Sebastian,
> 
> Can you please provide the explain output detailing the execution plan for 
> both queries for comparison, as detailed at:
> 
>       http://docs.openlinksw.com/virtuoso/perfdiag.html#perfdiagqueryplans
>       http://docs.openlinksw.com/virtuoso/fn_explain.html
> 
> Note you must include the "sparql" keyword before the start of each query. 
> Please also provide the output of running the status(); command to provide 
> access statistics on the server.
> 
> Best Regards
> Hugh Williams
> Professional Services
> OpenLink Software
> Web: http://www.openlinksw.com
> Support: http://support.openlinksw.com
> Forums: http://boards.openlinksw.com/support
> Twitter: http://twitter.com/OpenLink
> 
> On 29 Apr 2010, at 16:40, Sebastian Trüg wrote:
> 
>> Hello,
>>
>> using a V6 server with default indexes I would like to know why the
>> following queries are different in performance. The store contains
>> thousands of different graphs but adding a "graph ?g {}" around all
>> patterns does not change the execution time.
>>
>> select * where { ?r a nfo:FileDataObject .
>>                 ?r nfo:fileName ?f .
>>                 ?f bif:contains 'breaking' . }
>>
>> takes a long time to finish - almost a minute.
>>
>>
>> select * where { ?r nfo:fileName ?f .
>>                 ?f bif:contains 'breaking' . }
>>
>> is finished in no time.
>>
>> I just would like to understand the reasons behind the difference. If
>> possible also a solution. :)
>>
>> Cheers,
>> Sebastian
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Virtuoso-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
> 
> 
SQL> explain('sparql select * where { ?r 
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> ?f . ?f 
bif:contains \'breaking\' . }');REPORT
VARCHAR
_______________________________________________________________________________

{ 
 
Precode:
      0: $20 "callret" := Call __I2IDN (<constant (#i1020009)>)
      5: BReturn 0
CONTAINS (<constant ([ __enc "UTF-8" ] breaking)>) node on 
DB.DBA.RDF_OBJ_RO_FLAGS_WORDS         0 rows
$24 "t2.O"
from DB.DBA.RDF_QUAD by RDF_QUAD_POGS    3.3e+02 rows   
Key RDF_QUAD_POGS  ASC ($29 "t2.S")
<col=547 P = $20 "callret"> , <col=548 O = $24 "t2.O">
 
 
After code:
      0: $32 "r" := Call __ID2I ($29 "t2.S")
      5: $33 "f" := Call __RO2SQ ($24 "t2.O")
      10: BReturn 0
Select ($32 "r", $33 "f", <$31 "<DB.DBA.RDF_QUAD t2>" spec 5>)
}


============================================================


SQL> explain('sparql select * where { ?r a 
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject> . ?r 
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> ?f . ?f 
bif:contains \'breaking\' . }');
REPORT
VARCHAR
_______________________________________________________________________________

{ 
 
Precode:
      0: $20 "callret" := Call __I2IDN (<constant (#i1)>)
      5: $21 "callret" := Call __I2IDN (<constant (#i1020001)>)
      10: $22 "callret" := Call __I2IDN (<constant (#i1020009)>)
      15: BReturn 0
from DB.DBA.RDF_QUAD by RDF_QUAD_POGS       0.72 rows   
Key RDF_QUAD_POGS  ASC ($24 "s-1-1-t0.S")
<col=547 P = $20 "callret"> , <col=548 O = $21 "callret">
row specs: <col=548 O LIKE <constant (T�)>>
 
 
Precode:
      0: $27 "r" := Call __ID2I ($24 "s-1-1-t0.S")
      5: BReturn 0
Subquery 28 
{ 
CONTAINS (<constant ([ __enc "UTF-8" ] breaking)>) node on 
DB.DBA.RDF_OBJ_RO_FLAGS_WORDS         0 rows
$36 "s-1-1-t1-int.O"
from DB.DBA.RDF_QUAD by RDF_QUAD_POGS    3.3e+02 rows   
Key RDF_QUAD_POGS  ASC ($43 "s-1-1-t1-int.G", $42 "s-1-1-t1-int.S", $41 
"s-1-1-t1-int.P")
<col=547 P = $22 "callret"> , <col=548 O = $36 "s-1-1-t1-int.O">
row specs: <col=546 S = $24 "s-1-1-t0.S">
 Local Code
      0: $29 "decf336~G" :=  := artm $43 "s-1-1-t1-int.G"
      4: $30 "4c72d0~S" :=  := artm $42 "s-1-1-t1-int.S"
      8: $31 "d88f336~P" :=  := artm $41 "s-1-1-t1-int.P"
      12: $32 "381b76b~O" :=  := artm $36 "s-1-1-t1-int.O"
      16: BReturn 0
 
Subquery Select($29 "decf336~G", $30 "4c72d0~S", $31 "d88f336~P", $32 
"381b76b~O", <$45 "<DB.DBA.RDF_QUAD s-1-1-t1-int>" spec 5>)
}
 
 
After code:
      0: $52 "f" := Call __RO2SQ ($32 "381b76b~O")
      5: BReturn 0
Select ($27 "r", $52 "f", <$26 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>)
}


=============================================


SQL> explain('sparql select * where { graph ?g { ?r a 
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject> . ?r 
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> ?f . ?f 
bif:contains \'breaking\' . } . }');
REPORT
VARCHAR
_______________________________________________________________________________

{ 
 
Precode:
      0: $20 "callret" := Call __I2IDN (<constant (#i1)>)
      5: $21 "callret" := Call __I2IDN (<constant (#i1020001)>)
      10: $22 "callret" := Call __I2IDN (<constant (#i1020009)>)
      15: BReturn 0
from DB.DBA.RDF_QUAD by RDF_QUAD_POGS       0.72 rows   
Key RDF_QUAD_POGS  ASC ($25 "s-1-2-t0.G", $24 "s-1-2-t0.S")
<col=547 P = $20 "callret"> , <col=548 O = $21 "callret">
row specs: <col=548 O LIKE <constant (T�)>>
 
Subquery 28 
{ 
CONTAINS (<constant ([ __enc "UTF-8" ] breaking)>) node on 
DB.DBA.RDF_OBJ_RO_FLAGS_WORDS         0 rows
$36 "s-1-2-t1-int.O"
from DB.DBA.RDF_QUAD by RDF_QUAD    3.3e+02 rows   
Key RDF_QUAD  ASC ($43 "s-1-2-t1-int.G", $42 "s-1-2-t1-int.S", $41 
"s-1-2-t1-int.P")
 inlined <col=547 P = $22 "callret"> , <col=546 S = $24 "s-1-2-t0.S"> , 
<col=548 O = $36 "s-1-2-t1-int.O"> , <col=545 G = $25 "s-1-2-t0.G">
 Local Code
      0: $29 "decf336~G" :=  := artm $43 "s-1-2-t1-int.G"
      4: $30 "4c72d0~S" :=  := artm $42 "s-1-2-t1-int.S"
      8: $31 "d88f336~P" :=  := artm $41 "s-1-2-t1-int.P"
      12: $32 "381b76b~O" :=  := artm $36 "s-1-2-t1-int.O"
      16: BReturn 0
 
Subquery Select($29 "decf336~G", $30 "4c72d0~S", $31 "d88f336~P", $32 
"381b76b~O", <$45 "<DB.DBA.RDF_QUAD s-1-2-t1-int>" spec 5>)
}
 
 
After code:
      0: $52 "g" := Call __ID2I ($29 "decf336~G")
      5: $53 "r" := Call __ID2I ($30 "4c72d0~S")
      10: $54 "f" := Call __RO2SQ ($32 "381b76b~O")
      15: BReturn 0
Select ($52 "g", $53 "r", $54 "f", <$27 "<DB.DBA.RDF_QUAD s-1-2-t0>" spec 5>)
}


=============================================


SQL> status();
REPORT
VARCHAR
_______________________________________________________________________________

OpenLink Virtuoso  Server
Version 06.01.3127-pthreads for Linux as of Apr 10 2010 
Started on: 2010/04/30 15:01 GMT+120
Lite Mode
 
Database Status:
  File size 4448059392, 542976 pages, 122849 free.
  12000 buffers, 12000 used, 1157 dirty 0 wired down, repl age 15840 0 w. io 0 
w/crsr.
  Disk Usage: 33731 reads avg 2 msec, 0% r 0% w last  0 s, 69 writes,
    275 read ahead, batch = 98.  Autocompact 0 in 0 out, 0% saved.
Gate:  128 2nd in reads, 0 gate write waits, 0 in while read 0 busy scrap. 
Log = 
/home/trueg/.kde4/share/apps/nepomuk/repository/main/data/virtuosobackend/soprano-virtuoso.trx,
 210222 bytes
418925 pages have been changed since last backup (in checkpoint state)
Current backup timestamp: 0x0000-0x00-0x00
Last backup date: unknown
Clients: 7 connects, max 5 concurrent
RPC: 66545 calls, 0 pending, 4 max until now, 0 queued, 886 burst reads (1%), 1 
second brk=33529856
Checkpoint Remap 0 pages, 0 mapped back. 0 s atomic time.
    DB master 542976 total 122849 free 0 remap 0 mapped back
   temp  1280 total 1275 free
 
Lock Status: 0 deadlocks of which 0 2r1w, 0 waits,
   Currently 1 threads running 0 threads waiting 0 threads in vdb.
Pending:
 
Client 1111:1:-7:  Account: dba, 1580 bytes in, 806 bytes out, 0 stmts.
PID: 24692, OS: unix, Application: unknown, IP#: 127.0.0.1
Transaction status: PENDING, 0 threads.
Locks: 
 
Client 1111:1:-3:  Account: dba, 863276 bytes in, 627987 bytes out, 0 stmts.
PID: 24692, OS: unix, Application: unknown, IP#: 127.0.0.1
Transaction status: PENDING, 0 threads.
Locks: 
 
Client 1111:1:-2:  Account: dba, 492 bytes in, 2330 bytes out, 0 stmts.
PID: 24692, OS: unix, Application: unknown, IP#: 127.0.0.1
Transaction status: PENDING, 0 threads.
Locks: 
 
Client 1111:6:  Account: dba, 2359 bytes in, 6603 bytes out, 1 stmts.
PID: 24727, OS: unix, Application: unknown, IP#: 127.0.0.1
Transaction status: PENDING, 1 threads.
Locks: 
 
Client 1111:1:-5:  Account: dba, 9534683 bytes in, 14060705 bytes out, 0 stmts.
PID: 24692, OS: unix, Application: unknown, IP#: 127.0.0.1
Transaction status: PENDING, 0 threads.
Locks: 
 
 
Running Statements:
 Time (msec) Text
          47 status()
 
 
Hash indexes
 

Reply via email to