Hi Mitko, alright, I did the same with
sparql select count(?conflict) where { ?conflict a <http://dbpedia.org/ontology/MilitaryConflict> ; ?p <http://dbpedia.org/ontology/Event> . ?p rdfs:subPropertyOf rdf:type ; <http://www.w3.org/2006/time#hasBeginning> ?dateBegin . }; I also attached the plan for this count query at the bottom. Cheers, Martin --- AFTER SERVER RESTART --- SQL> status(); REPORT VARCHAR _______________________________________________________________________________ OpenLink Virtuoso Server Version 06.01.3127-pthreads for Linux as of Apr 19 2010 Started on: 2010/04/23 13:39 GMT+120 Database Status: File size 6257901568, 763904 pages, 408005 free. 2621440 buffers, 3193 used, 0 dirty 0 wired down, repl age 0 0 w. io 0 w/crsr. Disk Usage: 3268 reads avg 0 msec, 0% r 0% w last 0 s, 134 writes, 25 read ahead, batch = 102. Autocompact 0 in 0 out, 0% saved. Gate: 794 2nd in reads, 0 gate write waits, 0 in while read 0 busy scrap. Log = data/narysubproperty.trx, 87 bytes 355829 pages have been changed since last backup (in checkpoint state) Current backup timestamp: 0x0000-0x00-0x00 Last backup date: unknown Clients: 1 connects, max 1 concurrent RPC: 4 calls, 1 pending, 1 max until now, 0 queued, 0 burst reads (0%), 0 second brk=21520359424 Checkpoint Remap 19 pages, 0 mapped back. 0 s atomic time. DB master 763904 total 408005 free 19 remap 0 mapped back temp 256 total 251 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: Account: dba, 203 bytes in, 256 bytes out, 1 stmts. PID: 8745, OS: unix, Application: unknown, IP#: 127.0.0.1 Transaction status: PENDING, 1 threads. Locks: Running Statements: Time (msec) Text 87 status() Replication Status: Server db-ALX-DEV03. db-ALX-DEV03 db-ALX-DEV03 0 OFF. Hash indexes 43 Rows. -- 88 msec. SQL> select * from sys_d_stat where INDEX_NAME like 'RDF_QUAD%'; KEY_TABLE INDEX_NAME TOUCHES READS READ_PCT N_DIRTY N_BUFFERS VARCHAR NOT NULL VARCHAR INTEGER INTEGER INTEGER INTEGER INTEGER _______________________________________________________________________________ DB.DBA.RDF_QUAD RDF_QUAD 4505 930 20 0 930 DB.DBA.RDF_QUAD RDF_QUAD_GS 0 0 0 0 0 DB.DBA.RDF_QUAD RDF_QUAD_OP 0 0 0 0 0 DB.DBA.RDF_QUAD RDF_QUAD_POGS 432 1657 382 0 1657 DB.DBA.RDF_QUAD RDF_QUAD_SP 3634 3 0 0 3 5 Rows. -- 292 msec. --- QUERY --- SQL> sparql select count(?conflict) where { ?conflict a <http://dbpedia.org/ontology/MilitaryConflict> ; ?p <http://dbpedia.org/ontology/Event> . ?p rdfs:subPropertyOf rdf:type ; <http://www.w3.org/2006/time#hasBeginning> ?dateBegin . }; callret-0 INTEGER _______________________________________________________________________________ 4250 1 Rows. -- 9050 msec. --- AFTER QUERY --- SQL> status(); REPORT VARCHAR _______________________________________________________________________________ OpenLink Virtuoso Server Version 06.01.3127-pthreads for Linux as of Apr 19 2010 Started on: 2010/04/23 13:39 GMT+120 Database Status: File size 6257901568, 763904 pages, 408005 free. 2621440 buffers, 42470 used, 0 dirty 0 wired down, repl age 0 0 w. io 0 w/crsr. Disk Usage: 42545 reads avg 0 msec, 0% r 0% w last 128 s, 134 writes, 227 read ahead, batch = 178. Autocompact 0 in 0 out, 0% saved. Gate: 860 2nd in reads, 0 gate write waits, 0 in while read 0 busy scrap. Log = data/narysubproperty.trx, 87 bytes 355829 pages have been changed since last backup (in checkpoint state) Current backup timestamp: 0x0000-0x00-0x00 Last backup date: unknown Clients: 2 connects, max 1 concurrent RPC: 12 calls, 0 pending, 1 max until now, 0 queued, 6 burst reads (50%), 0 second brk=21527314432 Checkpoint Remap 19 pages, 0 mapped back. 0 s atomic time. DB master 763904 total 408005 free 19 remap 0 mapped back temp 256 total 251 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:2: Account: dba, 702 bytes in, 1016 bytes out, 1 stmts. PID: 8747, OS: unix, Application: unknown, IP#: 127.0.0.1 Transaction status: PENDING, 1 threads. Locks: Running Statements: Time (msec) Text 84 status() Replication Status: Server db-ALX-DEV03. db-ALX-DEV03 db-ALX-DEV03 0 OFF. Hash indexes 43 Rows. -- 86 msec. SQL> select * from sys_d_stat where INDEX_NAME like 'RDF_QUAD%'; KEY_TABLE INDEX_NAME TOUCHES READS READ_PCT N_DIRTY N_BUFFERS VARCHAR NOT NULL VARCHAR INTEGER INTEGER INTEGER INTEGER INTEGER _______________________________________________________________________________ DB.DBA.RDF_QUAD RDF_QUAD 17981 11244 62 0 11244 DB.DBA.RDF_QUAD RDF_QUAD_GS 0 0 0 0 0 DB.DBA.RDF_QUAD RDF_QUAD_OP 0 0 0 0 0 DB.DBA.RDF_QUAD RDF_QUAD_POGS 3811901 30618 0 0 30618 DB.DBA.RDF_QUAD RDF_QUAD_SP 3634 3 0 0 3 5 Rows. -- 273 msec. --- QUERY PLAN --- SQL> explain('sparql select count(?conflict) where { ?conflict a <http://dbpedia.org/ontology/MilitaryConflict> ; ?p <http://dbpedia.org/ontology/Event> . ?p rdfs:subPropertyOf rdf:type ; <http://www.w3.org/2006/time#hasBeginning> ?dateBegin . }'); REPORT VARCHAR _______________________________________________________________________________ { Precode: 0: $20 "callret" := Call min_bnode_iri_id () 5: $21 "callret" := Call __i2idn (<constant (#i868)>) 10: $22 "callret" := Call __i2idn (<constant (#i1)>) 15: $23 "callret" := Call __i2idn (<constant (#i1030009)>) 20: $24 "callret" := Call __i2idn (<constant (#i1021055)>) 25: $25 "callret" := Call __i2idn (<constant (#i1021199)>) 30: BReturn 0 Fork 43 { from DB.DBA.RDF_QUAD by RDF_QUAD_POGS 0.21 rows Key RDF_QUAD_POGS ASC ($27 "s-1-1-t2.S") <col=551 P = $21 "callret"> , <col=552 O = $22 "callret"> row specs: <col=552 O LIKE <constant (T�)>> , <col=550 S < $20 "callret"> from DB.DBA.RDF_QUAD by RDF_QUAD_POGS 0.22 rows Key RDF_QUAD_POGS ASC ($32 "s-1-1-t1.P", $31 "s-1-1-t1.S") <col=551 P = $27 "s-1-1-t2.S"> , <col=552 O = $24 "callret"> row specs: <col=552 O LIKE <constant (T�)>> from DB.DBA.RDF_QUAD by RDF_QUAD 0.16 rows Key RDF_QUAD ASC ($36 "s-1-1-t0.S") inlined <col=551 P = $22 "callret"> , <col=550 S = $31 "s-1-1-t1.S"> , <col=552 O = $25 "callret"> row specs: <col=552 O LIKE <constant (T�)>> Precode: 0: if ($36 "s-1-1-t0.S" 16( IS NULL ) <constant (0)>) then 3 else 8 unkn 8 3: $39 "callret" := := artm <constant (0)> 7: Jump 12 (level=0) 8: $39 "callret" := := artm <constant (1)> 12: BReturn 0 from DB.DBA.RDF_QUAD by RDF_QUAD 0.22 rows Key RDF_QUAD ASC () inlined <col=551 P = $23 "callret"> , <col=550 S = $32 "s-1-1-t1.P"> row specs: <col=550 S < $20 "callret"> Local Code 0: if ($39 "callret" 16( IS NULL ) <none> ) then 15 else 3 unkn 15 3: if ($45 "callret-0" 16( IS NULL ) <none> ) then 6 else 11 unkn 15 6: $45 "callret-0" := := artm $39 "callret" 10: Jump 15 (level=0) 11: $45 "callret-0" := artm $45 "callret-0" + $39 "callret" 15: BReturn 0 } Select ($45 "callret-0", <$42 "<DB.DBA.RDF_QUAD s-1-1-t3>" spec 5>, <$38 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>, <$34 "<DB.DBA.RDF_QUAD s-1-1-t1>" spec 5>, <$29 "<DB.DBA.RDF_QUAD s-1-1-t2>" spec 5>) } 49 Rows. -- 3 msec. Am 22.04.2010 18:40, schrieb Mitko Iliev: > Hi Martin, > > To eliminate the time to retrieve the result set do a 'sparql select > count(*) where ( ... ) ' , this would give us the time to execute > query server side. The rest is transmitting results to client, should > see difference. > > Best Regards, Mitko > -- ------------------------------------------------------------------------ Martin Gerlach Research Neofonie Technologieentwicklung und Informationsmanagement GmbH Robert-Koch-Platz 4 10115 Berlin fon: +49.30 24627 413 fax: +49.30 24627 120 martin.gerl...@neofonie.de <mailto:martin.gerl...@neofonie.de> http://www.neofonie.de Handelsregister Berlin-Charlottenburg: HRB 67460 Geschaeftsfuehrung Helmut Hoffer von Ankershoffen (Sprecher der Geschaeftsfuehrung) Nurhan Yildirim ------------------------------------------------------------------------ Das WePad ist ein Tablet der neuesten Generation. Dem Nutzer bietet es schnellen Zugang zum Internet, eine komplette Welt von sofort nutzbaren Applikationen und einfachen Zugriff auf Bücher, Fotos sowie auf Magazine und Tageszeitungen verschiedener Verlage, die mit dem WeMagazine ePublishing Eco System realisiert wurden. Mehr über das WePad auf www.wepad.mobi <http://www.wepad.mobi> oder auf www.facebook.com/WePad <http://www.facebook.com/WePad>.