On 10/14/16 12:41 PM, CHARBEL EL KAED wrote:
>
> Hello,
>
>  
>
> I would like to have your opinion on the following:
>
>  
>
> I installed Virtuoso Enterprise on a Windows VM with:
>
> 8 cores
>
> 28 GB RAM
>
> 56 GB SSD
>
>  
>
> I attached virtuoso configuration file.
>
>  
>
> On virtuoso I have a local RDF Table with 8221 triples and a remote MS
> SQL Azure with 50 million records. A record is simply an id, param1
> and param2, with (id and param1) as a composite primary key.
>
> I have the following query:
>
>  
>
> Select ?id ?param1 ?param2 {
>
>                Select ?id ?param1 ?param2 FROM
> <http://localhost:8890/sqldb50m# <http://localhost:8890/sqldb50m>>
>
>  Where {
>
> [] <http://localhost:8890/schemas/sqldb50m/id> ?id;
>
> <http://localhost:8890/schemas/ sqldb50m /param1
> <http://localhost:8890/schemas/%20sqldb50m%20/param1>> ? param1;
>
> <http://localhost:8890/schemas/ sqldb50m /param2
> <http://localhost:8890/schemas/%20sqldb50m%20/param2%20>> ? param2. 
>
> filter (?param1 < 5)
>
> {
>
> SELECT DISTINCT (strafter(str(?id1), "#") AS ?trimId) from
> <http://localhost:8890/BOC# <http://localhost:8890/BOC>>
>
> WHERE
>
> {
>
> ?server qt:hasId ?id1. //returns 42 ids
>
> }
>
> }
>
> filter( ?trimId = ?id)
>
> }
>
>          };
>
>  
>
> The query is expected to return 1 million record result.
>
> I initiated the query yesterday through iSQL, it is still running
> since, more than 12 hours. On the Windows VM, the task manager shows
> that Virtuoso consumes 10 GB of RAM and less then 5% of CPU.
>
> On the MS SQL monitoring tool, you can notice the load is constant
> using only 10% of the CPU and 10% of the DTU.
>
>  
>
> Any recommendations to improve the performance?
>
>  
>
> Thank you
>

There should be an update in your support case about this matter.
Fundamentally, there was a SPARQL Optimizer bug that lead to the shared
variable effect not kicking in i.e., executing the remote part of the
query. Here are examples to explain the gist of the matter:


## Problematic  due to missing {} around dataset modifier fragments that
contain shared variables between local and remote

## Data Sources

SELECT ?s ?p (sql:BEST_LANGMATCH (?o, "ru, en-gb;q=0.8, en;q=0.7,
*;q=0.1", "")) as ?o_filtered
WHERE {
        ?s a foaf:Person .
        # Virtuoso Extension for setting Named Graph scope on a Remote
SPARQL service
        SERVICE <http://dbpedia.org/sparql> from <http://dbpedia.org>
              {
                 ?s ?p ?o .
                 FILTER (?p != <http://dbpedia.org/property/abstract>)
              }
                 
        OPTIONAL { ?p rdfs:label ?lbl }
      }
ORDER BY ASC (COUNT (?o))


## Revised query using {} to group dataset modifier fragments to set
scope for shared variable identifiers

SELECT ?s ?p (sql:BEST_LANGMATCH (?o, "ru, en-gb;q=0.8, en;q=0.7,
*;q=0.1", "")) as ?o_filtered
WHERE {    *    
*

*          {  **## shared variable block start ##*
            ?s a foaf:Person .
            # Virtuoso Extension for setting Named Graph scope on a
Remote SPARQL service
            SERVICE <http://dbpedia.org/sparql> from <http://dbpedia.org>
                  {
                     ?s ?p ?o .
                     FILTER (?p != <http://dbpedia.org/property/abstract>)
                  }
 *       ***## shared variable block end ## *}*
        OPTIONAL { ?p rdfs:label ?lbl }
      }
ORDER BY ASC (COUNT (?o))


## Another example that failed where I am passing values using BIND.
This failed and will work properly when the fix is in ##

PREFIX csv:
<https://gist.githubusercontent.com/lawlesst/bdbd2142c2ab667eae1be3b7a789f5da/raw/643196cb31a13ddc3746d7a340bf3674d31f3bc2/top_250_by_pages.csv#>

SELECT ?w ?p ?o2
FROM NAMED
<https://gist.githubusercontent.com/lawlesst/bdbd2142c2ab667eae1be3b7a789f5da/raw/643196cb31a13ddc3746d7a340bf3674d31f3bc2/top_250_by_pages.csv>

WHERE {
        GRAPH
<https://gist.githubusercontent.com/lawlesst/bdbd2142c2ab667eae1be3b7a789f5da/raw/643196cb31a13ddc3746d7a340bf3674d31f3bc2/top_250_by_pages.csv>
              {?s csv:wikidata ?o . }
        BIND (IRI(?o) AS ?w)
        SERVICE <http://dbpedia.org/sparql> { SELECT * WHERE {?w ?p ?o2.
} LIMIT 50 }
 
}

-- 
Regards,

Kingsley Idehen       
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
        : 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to