How to report Virtuoso "Internal Optimiser" errors

What

This document details the information that needs to be provided for diagnosing the cause of query optimizer issues that can result in bad query plans being devised and executed.

Why

The Virtuoso query optimizer at times generates bad query execution plans, which can result in the query not executing as expected, resulting in:

  • Poor performance of executed query
  • Query hanging during execution
  • System running out of memory trying to optimise the query
  • VECSL: Internal error, ssl refd before set, please report query to support error

How

The following information should be provided to aid the diagnosis of such problems, using the Virtuoso isql command line tool:

  • The git hash of the Virtuoso binary being used to identify the exact source code archive it was built from with the command:
select sys_stat('git_head');
__dbf_set ('dbf_explain_level', 2);
explain('<query text>');
string_to_file('stat.dv', serialize(stat_export()), -2);
  • For a SPARQL query, the SPARQL to SQL translation with the commands:
SET SPARQL_TRANSLATE ON;
SPARQL QUERY;
SET SPARQL_TRANSLATE OFF;
  • The Virtuoso configuration file virtuoso.ini
  • The Operating System and version in use.

Related