STATEMENT REGARDING PRIOR DISCLOSURES BY THE INVENTOR OR A JOINT INVENTOR

The following disclosure(s) are submitted under 35 U.S.C. 102(b)(1)(A): DB2 for i, Apr. 7, 2016.

BACKGROUND

This disclosure relates generally to database management systems and, more particularly, relates to transforming a user-defined table function (UDTF) to a derived table in a database management system (DBMS). Databases are used to store information for numerous types of applications. Examples include various industrial, commercial, technical, scientific, and educational applications. Database management systems (DBMSs) are a typical mechanism for accessing data stored in a database. DBMSs are typically configured to separate the process of storing data from accessing, manipulating, or using data stored in a database. DBMSs often require tremendous resources to handle the heavy workloads placed on such systems. As such, it may be useful to transform a UDTF to a derived table in a DBMS.

SUMMARY

Aspects of the disclosure relate to transforming a user-defined table function (UDTF) to a derived table in a database management system (DBMS). A set of structured query language (SQL) statements may be identified from within a UDTF of a database query. The UDTF may be inlined as a derived table or laterally correlated derived table within the database query. One or more optimization operations may be performed on the database query including the derived table to facilitate processing and execution. As such, by inlining the UDTF as a derived table or laterally correlated derived table, the set of SQL statements may be included within the database query such that calls to user code may be avoided, and optimization operations may be performed on the query and derived table as a whole.

Aspects of the disclosure relate to transforming a user-defined table function (UDTF) to a derived table in a database management system (DBMS). It may be detected by the DBMS that a query indicates the UDTF. A derived table may be constructed from the UDTF. The derived table may be derived from a set of statements of the UDTF. The derived table may be introduced to the query to fulfill the UDTF. A query plan may be generated for the query by the DBMS. The query plan may be generated in response to introducing the derived table in the query.

The above summary is not intended to describe each illustrated embodiment or every implementation of the present disclosure.

