Hi

I read https://jena.apache.org/documentation/tdb/optimizer.html 
<https://jena.apache.org/documentation/tdb/optimizer.html> and searched through 
the mailing list but did not find a satisfying answer:

I generate an offline TDB2 database using tdb2.tdbloader. Once this is done, I 
run the following:

$ tdb2.tdbstats --loc /srv/linked_data_store/new_base_db > 
/srv/linked_data_store/tmp/stats.opt
$ mv /srv/linked_data_store/tmp/stats.opt /srv/linked_data_store/new_base_db/
$ cp stats.opt Data-0001/
(I place the stats.opt in both locations because I'm not sure which one is 
right)

The stats file looks completely reasonable from what I can tell:

$ head stats.opt 
(stats
  (meta
    (timestamp 
"2018-10-10T06:41:00.325+00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
    (run@ "2018/10/10 06:41:00 UTC")
    (count 539607479))
  ((VAR <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://purl.org/linked-data/cube#MeasureProperty>)
   14)
  ((VAR <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.opengis.net/ont/geosparql#Geometry>)
   1607)

The numbers are correct. I assumed, that this file should be read by the fuseki 
server, but this seems not to be the case:

[2018-10-10 06:46:14] Fuseki     INFO  [1] Query = select (count(*) as ?count) 
{?s ?p ?o}
[2018-10-10 06:49:14] Fuseki     INFO  [1] 200 OK (179.752 s)

Trying the offline query with --explain takes about the same amount of time:

$ tdb2.tdbquery --explain --loc=/srv/linked_data_store/new_base_db "select 
(count(*) as ?count) {?s ?p ?o}"
06:51:01 INFO  exec                 :: QUERY
  SELECT  (count(*) AS ?count)
  WHERE
    { ?s  ?p  ?o }
06:51:01 INFO  exec                 :: ALGEBRA
  (project (?count)
    (extend ((?count ?.0))
      (group () ((?.0 (count)))
        (quadpattern (quad <urn:x-arq:DefaultGraphNode> ?s ?p ?o)))))
06:51:01 INFO  exec                 :: TDB
  (project (?count)
    (extend ((?count ?.0))
      (group () ((?.0 (count)))
        (quadpattern (quad <urn:x-arq:DefaultGraphNode> ?s ?p ?o)))))
06:51:01 INFO  exec                 :: Execute ::   ?s ?p ?o
-------------
| count     |
=============
| 539607479 |
-------------

Am I missing something, or do I have to tell the configuration to load the 
stats file?
Or is my assumption wrong, that the count should be read from the stats file?

Any help on this would be highly appreciated.

Thanks for your time and kind regards
Markus

Reply via email to