1 / 8

Meta-SQL: Towards practical meta-querying

Meta-SQL: Towards practical meta-querying. Gottfried Vossen University of Muenster. Jan Van den Bussche Stijn Vansummeren Limburgs Universitair Centrum. Context. Enterprise databases contain not only data but also queries: view definitions stored procedures usage logs workloads

Download Presentation

Meta-SQL: Towards practical meta-querying

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Meta-SQL: Towards practical meta-querying Gottfried Vossen University of Muenster Jan Van den Bussche Stijn Vansummeren Limburgs Universitair Centrum

  2. Context Enterprise databases contain not only data but also queries: • view definitions • stored procedures • usage logs • workloads • software engineering Stored as long strings… • Difficult to query in standard SQL

  3. Goal Allow meta-querying: query the stored queries together with ordinary data • Which queries do the most joins? • Which queries return an empty answer? • What are common subexpressions in this workload? • If I do these updates, which materialized views change their value?

  4. Contribution Meta-SQL: conservative extension of SQL to allow meta-querying • store queries in XML • call XSLT within SQL • add XML-variables • add an EVAL function Works on top of any SQL99-compliant DBMS Prototype with DB2 UDB

  5. Call XSLT within SQL Which queries do the most joins? select name from Views where count_tables(def) = (select max( ( )) from Views) count_tables def written in XSLT view definition in XML

  6. XML-variables What are the common subqueries? arbitrary Xpath-expression select s from Views, s in def[ ] group by s having count(name)>=2 //query s ranges over all query-subelements of stored query

  7. EVAL function Which queries return an empty answer? select name from Views where not exists (select * from EVAL(def)) EVAL produces query results in SQL row variable UEVAL produces them in XML-variable

  8. Implementation compilation execution XSLT functions Meta-SQL query SQL statements (CREATE FUNCTION) Java wrappers Rewriting in SQL99 SAXON (XML processing) Extract (XML variables) EVAL

More Related