title: Named subquery slow in Wikidata Query Service
body: <p>I am wondering why the following SPARQL query with a named subquery is slow on Blazegraph instance Wikidata Query Service. Taking out the subquery and executing that alone completes in around a second on the Wikidata Query Service, while the one with the entire query times out.  Adding anything after the INCLUDE line does not seem to help. Removing DISTINCT does not help.</p>
  <pre><code>SELECT
    ?author
  WITH {
    SELECT
      DISTINCT ?author
    {
      [] wdt:P50 ?author .
      FILTER EXISTS { [] wdt:P921 ?author }
      FILTER EXISTS { ?author wdt:P31 wd:Q5 }
    }
    LIMIT 1
  } AS %authors
  WHERE {
    INCLUDE %authors .
  }
  </code></pre>
  <p>Might some combination of query hints help? I have been glancing through the Blazegraph query hints at <a href="https://github.com/blazegraph/database/wiki/QueryHints" rel="nofollow noreferrer">https://github.com/blazegraph/database/wiki/QueryHints</a>, but have not come up with the hint combination that solves the time out.</p>
  <p>When the named subquery is executed alone LIMIT can even be increased to 10000 on the Wikidata Query Service without running into a timeout.</p>