I'm getting different results in Studio than I am somewhere else, what's happening?

Created by Steve Place, Modified on Wed, Dec 11 at 10:24 AM by Steve Place

queryLimit


When you get different results in Studio compared to one of our APIs or to downloading a CSV of the output, the first place to check is always Studio's query limit. By default, queries in Studio are limited to 1000 results. You can change this on individual queries by adding "LIMIT X" to your query. You can change the default limit by opening Preferences (Ctrl + , on Windows and Cmd + , on Mac) and editing the value of queryLimit.



You can set queryLimit to 0 to turn off the limit.


Additional consideration for virtual graphs

There is a bug in versions of Stardog prior to 9.2 where virtual graph queries will apply LIMITs after DISTINCTs. (This refers to the SQL query sent to the data source, NOT the SPARQL query you enter into Studio.) This means if the LIMIT is 1000, you may get fewer than 1000 results, even if the query should return 1000 results.


You can work around this bug by turning off DISTINCT with the pragma reasoning.distinct off query hint or by adding a DISTINCT in your SPARQL query.


Query plan caching


Studio's plan caching feature may also be causing different results between Studio and our APIs. Studio caches query plans to make future executions of the same query faster, and you can tell if this occurred by checking for "#reused" at the top of the query plan. To turn this off for a specific query, you can add the query hint #plan.cache off. To turn this off for every query in that database, set query.plan.reuse to NEVER.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article