robl wrote:
Ivan Mikhailov wrote:
Rob,

I've tried on my database (that is mix of dbpedia and few other
databases. Both queries return accurate results. So questions are:
1. What version of Virtuoso Open Source do you use?

5.0.6

2. What version of Virtuoso Open Source was used at the time you've
loaded the database?

It was 5.0.6 but I have had to recompile it after an upgrade from ubuntu dapper to ubuntu hardy.

3. Did you create any additional indexes in RDF_QUAD table?

I followed this guide for creating additional indexes :

http://www.openlinksw.com/dataspace/kide...@openlinksw.com/weblog/kide...@openlinksw.com%27s%20BLOG%20%5B127%5D/1298

I have loaded data after I created this though, although I'd assume this wouldn't be an issue. Other than that I haven't added any indexes.

4. What are the outputs of the following SQL commands:

explain ('sparql SELECT ?p ?o WHERE
{ <http://dbpedia.org/resource/Programmers> ?p ?o }');


Connected to OpenLink Virtuoso
Driver: 05.00.3028 OpenLink Virtuoso ODBC Driver
REPORT
VARCHAR
_______________________________________________________________________________

{

Precode:
0: $25 "org/resource/Programmers" := Call DB.DBA.RDF_MAKE_IID_OF_QNAME_SAFE (<constant (http://dbpedia.org/resource/Programmers)>)
       7: BReturn 0
from DB.DBA.RDF_QUAD by RDF_QUAD_PSOG
Key RDF_QUAD_PSOG  ASC ($28 "s-1-1-t0.P", $27 "s-1-1-t0.O")

row specs: <col=413 S = $25 "org/resource/Programmers">

Current of: <$30 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>

After code:
       0: $31 "p" := Call id_to_iri ($28 "s-1-1-t0.P")
       5: $32 "o" := Call __rdf_sqlval_of_obj ($27 "s-1-1-t0.O")
       10: BReturn 0
Select ($31 "p", $32 "o", <$30 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>)
}

18 Rows. -- 2 msec.



explain ('sparql SELECT ?o WHERE
{ <http://dbpedia.org/resource/Programmers>
 <http://dbpedia.org/property/redirect> ?o } ');

REPORT
VARCHAR
_______________________________________________________________________________

{

Precode:
0: $25 "org/resource/Programmers" := Call DB.DBA.RDF_MAKE_IID_OF_QNAME_SAFE (<constant (http://dbpedia.org/resource/Programmers)>) 7: $26 "org/property/redirect" := Call DB.DBA.RDF_MAKE_IID_OF_QNAME_SAFE (<constant (http://dbpedia.org/property/redirect)>)
       14: BReturn 0
from DB.DBA.RDF_QUAD by RDF_QUAD_PSOG
Key RDF_QUAD_PSOG  ASC ($28 "s-1-1-t0.O")
inlined <col=414 P = $26 "org/property/redirect"> , <col=413 S = $25 "org/resource/Programmers">

Current of: <$30 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>

After code:
       0: $31 "o" := Call __rdf_sqlval_of_obj ($28 "s-1-1-t0.O")
       5: BReturn 0
Select ($31 "o", <$30 "<DB.DBA.RDF_QUAD s-1-1-t0>" spec 5>)
}

17 Rows. -- 2 msec.

5. If index RDF_QUAD_OGPS is mentioned in the output of second explain()
but not in the output of the first explain(), then could you please
backup your database and try


I couldn't see RDF_QUAD_OGPS referenced in the above explain results.

Any other things I could try ?

Thanks


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

then re-try that queries?


I'll reply with my own fix :)

I dropped all created indexes :

drop index RDF_QUAD_OGPS;
drop index RDF_QUAD_POGS;
drop index RDF_QUAD_PSOG;
drop index RDF_QUAD_SOPG;

and then recreated them :

CREATE BITMAP index RDF_QUAD_OGPS on DB.DBA.RDF_QUAD (O,G,P,S);
CREATE BITMAP index RDF_QUAD_POGS on DB.DBA.RDF_QUAD (P,O,G,S);
CREATE BITMAP index RDF_QUAD_PSOG on DB.DBA.RDF_QUAD (P,S,O,G);
CREATE BITMAP index RDF_QUAD_SOPG on DB.DBA.RDF_QUAD (S,O,P,G);
checkpoint;

This seemed to fix the issue. Please note there seems to be a typo in the wiki article :

http://www.openlinksw.com/dataspace/kide...@openlinksw.com/weblog/kide...@openlinksw.com%27s%20BLOG%20%5B127%5D/1298

It references :

CREATE BITMAP index RDF_QUAD_PSOG on DB.DBA.RDF_QUAD (S,O,P,G);

Where I believe it should say :

CREATE BITMAP index RDF_QUAD_SOPG on DB.DBA.RDF_QUAD (S,O,P,G);

Thanks,

Rob

Reply via email to