Re: [Virtuoso-users] {Disarmed} Re: {Disarmed} Re: SQ156: Internal Optimized compiler error : sqlo table has no index in

2017-02-13 Thread Hugh Williams
Hi Jerven,

In Virtuoso 7+ the  RDF_QUAD table is created with COLUMN (column wise) indexes 
by default, whereas you seem to have been creating additional BITMAP (row wise) 
indexes , which is not recommended ie mixing column and row wise indexes as 
this can result in the unpredictable behaviour you are experiencing, see:


https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtRDFPerformanceTuning#RDF
 Index Scheme 


Is there a reason why these additional indexes were being tried as the 5 
default (2 full & 3 partial) column wise indexes should suffice for most use 
cases, with only one exception found to date which is detailed in the Index 
Scheme Selection section of the Wiki doc:


https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtRDFPerformanceTuning#Index
 Scheme Selection 


Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.  //  http://www.openlinksw.com/ 

Weblog   -- http://www.openlinksw.com/blogs/ 
LinkedIn -- http://www.linkedin.com/company/openlink-software/ 

Twitter  -- http://twitter.com/OpenLink 
Google+  -- http://plus.google.com/100570109519069333827/ 

Facebook -- http://www.facebook.com/OpenLinkSoftware 

Universal Data Access, Integration, and Management Technology Providers



> On 13 Feb 2017, at 08:49, Jerven Tjalling Bolleman  > wrote:
> 
> Hi Hugh,
> 
> I managed to reproduce.
> 
> PREFIX up:> ASK 
> {GRAPH {?subject a 
> up:Protein . ?subject up:annotation ?target .}}]
> 
> -> SQ156: Internal Optimized compiler error : sqlo table has no index in 
> sqldf.c:3777. Please report the statement compiled.
> 
> 
> SQL> SET SPARQL_TRANSLATE ON;
> SQL> sparql PREFIX up: > ASK {GRAPH 
> > 
> {?subject a up:Protein . ?subject 
> up:annotation ?target .}};
> SPARQL_TO_SQL_TEXT
> LONG VARCHAR
> ___
> 
> SELECT TOP 1 1 AS __ask_retval
> FROM DB.DBA.RDF_QUAD AS "s_1_2_t0"
>   INNER JOIN DB.DBA.RDF_QUAD AS "s_1_2_t1"
>   ON ( /* two fields belong to same equiv */
> /* retval[ */ "s_1_2_t1"."S" /* subject */ /* ]retval */ = /* 
> retval[ */ "s_1_2_t0"."S" /* subject */ /* ]retval */)
> WHERE /* field equal to URI ref */
>   "s_1_2_t0"."G" = __i2idn ( /* UNAME as sqlval */ __bft ( 
> 'http://sparq.uniprot.org/uniprot'  , 1))
>   AND  /* field equal to URI ref */
>   "s_1_2_t0"."P" = __i2idn ( /* UNAME as sqlval */ __bft ( 
> 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' 
>  , 1))
>   AND  /* field equal to URI ref */
>   "s_1_2_t0"."O" = __i2idn ( /* UNAME as sqlval */ __bft ( 
> 'http://purl.uniprot.org/core/Protein' 
>  , 1))
>   AND  /* field equal to URI ref */
>   "s_1_2_t1"."G" = __i2idn ( /* UNAME as sqlval */ __bft ( 
> 'http://sparq.uniprot.org/uniprot'  , 1))
>   AND  /* field equal to URI ref */
>   "s_1_2_t1"."P" = __i2idn ( /* UNAME as sqlval */ __bft ( 
> 'http://purl.uniprot.org/core/annotation' 
>  , 1))
> 
> However, to be honest. This is not a standard setup of the quad table.
> 
> It happens if adding this index
> CREATE BITMAP INDEX RDF_QUAD_P ON DB.DBA.RDF_QUAD (P)
> or
> CREATE DISTINCT NO PRIMARY KEY REF BITMAP INDEX RDF_QUAD_GP ON RDF_QUAD 
> (G, P) PARTITION (P INT (0hex00))
> 
> and then running the query.
> But funnily if you then restart the db, it works again!
> 
> Regards,
> Jerven
> 
> 
> 
> On 2017-02-09 17:28, Hugh Williams wrote:
>> Hi Jerven,
>> 
>> Thanks for the update, glad to hear you found the cause of the problem
>> …
>> 
>> Best Regards
>> Hugh Williams
>> Professional Services
>> 
>> OpenLink Software, Inc.  //
>> http://www.openlinksw.com/ 
>> Weblog   -- http://www.openlinksw.com/blogs/ 
>> 
>> LinkedIn -- http://www.linkedin.com/company/openlink-software/ 
>> 
>> Twitter  -- http://twitter.com/OpenLink 
>> Google+  -- MAILSCANNER HAS DETECTED DEFINITE FRAUD IN THE WEBSITE AT
>> "PLUS.GOOGLE.COM ". DO _NOT_ TRUST THIS 

Re: [Virtuoso-users] {Disarmed} Re: {Disarmed} Re: SQ156: Internal Optimized compiler error : sqlo table has no index in

2017-02-13 Thread Jerven Tjalling Bolleman
Hi Hugh,

I managed to reproduce.

PREFIX up: ASK {GRAPH {?subject a 
up:Protein . ?subject up:annotation ?target .}}]

-> SQ156: Internal Optimized compiler error : sqlo table has no index in 
sqldf.c:3777. Please report the statement compiled.


SQL> SET SPARQL_TRANSLATE ON;
SQL> sparql PREFIX up: ASK {GRAPH 
 {?subject a up:Protein . ?subject 
up:annotation ?target .}};
SPARQL_TO_SQL_TEXT
LONG VARCHAR
___

SELECT TOP 1 1 AS __ask_retval
FROM DB.DBA.RDF_QUAD AS "s_1_2_t0"
   INNER JOIN DB.DBA.RDF_QUAD AS "s_1_2_t1"
   ON ( /* two fields belong to same equiv */
 /* retval[ */ "s_1_2_t1"."S" /* subject */ /* ]retval */ = /* 
retval[ */ "s_1_2_t0"."S" /* subject */ /* ]retval */)
WHERE /* field equal to URI ref */
   "s_1_2_t0"."G" = __i2idn ( /* UNAME as sqlval */ __bft ( 
'http://sparq.uniprot.org/uniprot' , 1))
   AND  /* field equal to URI ref */
   "s_1_2_t0"."P" = __i2idn ( /* UNAME as sqlval */ __bft ( 
'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' , 1))
   AND  /* field equal to URI ref */
   "s_1_2_t0"."O" = __i2idn ( /* UNAME as sqlval */ __bft ( 
'http://purl.uniprot.org/core/Protein' , 1))
   AND  /* field equal to URI ref */
   "s_1_2_t1"."G" = __i2idn ( /* UNAME as sqlval */ __bft ( 
'http://sparq.uniprot.org/uniprot' , 1))
   AND  /* field equal to URI ref */
   "s_1_2_t1"."P" = __i2idn ( /* UNAME as sqlval */ __bft ( 
'http://purl.uniprot.org/core/annotation' , 1))

However, to be honest. This is not a standard setup of the quad table.

It happens if adding this index
CREATE BITMAP INDEX RDF_QUAD_P ON DB.DBA.RDF_QUAD (P)
or
CREATE DISTINCT NO PRIMARY KEY REF BITMAP INDEX RDF_QUAD_GP ON RDF_QUAD 
(G, P) PARTITION (P INT (0hex00))

and then running the query.
But funnily if you then restart the db, it works again!

Regards,
Jerven



On 2017-02-09 17:28, Hugh Williams wrote:
> Hi Jerven,
> 
> Thanks for the update, glad to hear you found the cause of the problem
> …
> 
> Best Regards
> Hugh Williams
> Professional Services
> 
> OpenLink Software, Inc.  //
> http://www.openlinksw.com/
> Weblog   -- http://www.openlinksw.com/blogs/
> LinkedIn -- http://www.linkedin.com/company/openlink-software/
> Twitter  -- http://twitter.com/OpenLink
> Google+  -- MAILSCANNER HAS DETECTED DEFINITE FRAUD IN THE WEBSITE AT
> "PLUS.GOOGLE.COM". DO _NOT_ TRUST THIS WEBSITE:
> http://plus.google.com/100570109519069333827/ [2]
> Facebook -- http://www.facebook.com/OpenLinkSoftware
> Universal Data Access, Integration, and Management Technology
> Providers
> 
>> On 9 Feb 2017, at 13:35, Jerven Tjalling Bolleman
>>  wrote:
>> Hi Hugh,
>> 
>> The source of the error was a truncated database file on my
>> developer desktop due to disk quota and a problem between my office
>> chair and my desk ;)
>> 
>> Regards,
>> Jerven
>> 
>> On 2017-02-06 20:58, Hugh Williams wrote:
>> Hi Jerven,
>> Does the same error occur when the query is run against the /sparql
>> endpoint or isql  ie not via the JDBC Driver ?
>> Also, are you able to get the  query “profile” or
>> “sparql_to_sql_text” for the query as detailed at:
>> 
> https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtTipsAndTricksAanalyzingSPARQLQuery
>> What version of Virtuoso is being used, is it a latest 07.20.3217
>> build ?
>> Best Regards
>> Hugh Williams
>> Professional Services
>> OpenLink Software, Inc.  //
>> http://www.openlinksw.com/
>> Weblog   -- http://www.openlinksw.com/blogs/
>> LinkedIn -- http://www.linkedin.com/company/openlink-software/
>> Twitter  -- http://twitter.com/OpenLink
>> Google+  -- MAILSCANNER HAS DETECTED DEFINITE FRAUD IN THE WEBSITE
>> AT
>> "MAILSCANNER HAS DETECTED DEFINITE FRAUD IN THE WEBSITE AT
>> "PLUS.GOOGLE.COM". DO _NOT_ TRUST THIS WEBSITE: PLUS.GOOGLE.COM
>> [1]". DO _NOT_ TRUST THIS WEBSITE:
>> MAILSCANNER HAS DETECTED DEFINITE FRAUD IN THE WEBSITE AT
>> "PLUS.GOOGLE.COM". DO _NOT_ TRUST THIS WEBSITE:
>> http://plus.google.com/100570109519069333827/ [2] [2]
>> Facebook -- http://www.facebook.com/OpenLinkSoftware
>> Universal Data Access, Integration, and Management Technology
>> Providers
>> On 6 Feb 2017, at 16:08, Jerven Tjalling Bolleman
>>  wrote:
>> Dear Virtuoso users,
>> I am getting an new error from virtuoso, during development of a new
>> feature
>> SPARQL execute failed:[SELECT (COUNT(?target) AS ?targets) { GRAPH
>> {?subject a
>>  . ?target a
>>  . ?subject
>>  ?target .}}]
>> Exception:virtuoso.jdbc4.VirtuosoException: SQ156: Internal
>> Optimized
>> compiler error : sqlo table has no index in sqldf.c:3777.
>> Please report the statement compiled.
>> Regards,
>> Jerven
>> --
>> Jerven Tjalling