Virtuoso SQL

Data Type Support

Supported SQL Features

SQL Optimizer

Virtuoso has a cost based optimizer that uses statistics for deciding join order, join type, index usage and other execution plan matters. Virtuoso supports hash and loop joins, reusing hash join hash tables if the underlying data does not change and merge intersection of indices for multiple index lookup. The optimizer automatically recognizes loop invariants and calculates these as early as possible. A special explain function allows viewing the execution plan. Optimizer directives exist for direct control of join order, join type and index usage.


Virttuoso implements role based security and optionally row level security based on user account and SQL object specific policies.

Role based security provides for arbitrary non-cyclic inheritance of roles, a single useror role belonging to multiple roles. A user or role is a valid grantee for table/view/column access, procedure execution and type instance creation or type inheritance.

Policy based security is enforced by the SQL compiler by inserting extra conditions into statements, depending on which user is preparing the statement. The tables or views can themselves be readable to a large group of users but compartmentalization is achieved by the database automatically adding extra conditions. For example, a policy procedure can look up the user's department and add conditions that limit the statement being compiled to data pertaining to the user's department.

Special hook functions are provided for user login and logout. These can for example consult an LDAP server for validating the credentials, perform extra logging or any other type of custom processing.

Procedure Language

The Virtuoso procedure language is an adaptation of PSM 96 with a C-like syntax.

CategoryWebSite CategoryOpenSource CategoryVirtuoso