Incomplete results

Hello support

When I run this query in the Virtuoso 7.2.5 console

sparql
select ?answer COUNT(?p) As ?nm 
{?answer sides:correspond_to_question ?q. 
?q sides:has_for_proposal_of_answer ?p. 
?p sides:has_for_correction '1'.  
FILTER NOT EXISTS 
{?a sides:is_part_of ?answer. 
?a sides:has_rightly_ticked ?p
} 
}

I got different results

attempt rows msec
1 20051490 399771
2 20005102 399537
3 20022052 397291

Just in case, I had set result_timeout = 0 (see 9.25. Anytime Queries)

Any idea about why the number of rows is different in the output?

Thanks,

Where are you running the query from the Virtuoso /sparql endpoint, the isql command line tool or other location ?

If running via the /sparql endpoint, what setting do you have in the [SPARQL] section of the virtuoso.ini file ?

I run the queries in the isql command line tool

What happens if you prepend the query with the DEFINE sql:select-option "order" pragma to turn off query optimisation, i.e. —

sparql
DEFINE sql:select-option "order"
select ?answer COUNT(?p) As ?nm 
{?answer sides:correspond_to_question ?q. 
?q sides:has_for_proposal_of_answer ?p. 
?p sides:has_for_correction '1'.  
FILTER NOT EXISTS 
{?a sides:is_part_of ?answer. 
?a sides:has_rightly_ticked ?p
} 
}
;

Thanks for your suggestion but the problem still remains

attempts | rows | msec
1 | 19633350 | 409011
2 | 19678830 | 405308
3 | 19689870 | 404871

What is the gitid and build date of the Virtuoso 7.2.5 binary you are using? This can be obtained by running the following command from the bin directory of the the Virtuoso installation:

./virtuoso-t -?

If not running a build from the latest git develop/7 branch, I would recommend building and updating to it, and then retrying the query.

I got this

Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.2.5.3229-pthreads as of Aug 21 2019 (000000)
Compiled for Linux (x86_64-pc-linux-gnu)
Copyright (C) 1998-2018 OpenLink Software

I will run a build from latest development branch and I will let you know how it goes.
Thanks

I run a build from latest git develop/7 and it works!

Finally, I got the size of the complete result. It is 21572897 rows.

Also, I tried Virtuoso 8 and I got the same complete result.

As additional information, I had to load the full dataset again because when I run the new
Virtuoso built (or Virtuoso 8) over the binary of the old database (virtuoso.db) I got incomplete results.

Thanks,

Glad to hear the upgrade to the latest git develop/7 branch resolved the problem.