Due to the importance of linear algebra and matrix operations in data analytics, there is significant interest in using relational query optimization and processing techniques for evaluating (sparse) linear algebra programs. In particular, in recent years close connections have been established between linear algebra programs and relational algebra that allow transferring optimization techniques of the latter to the former. In this paper, we ask ourselves which linear algebra programs in MATLANG correspond to the free-connex and q-hierarchical fragments of conjunctive first-order logic. Both fragments have desirable query processing properties: free-connex conjunctive queries support constant-delay enumeration after a linear-time preprocessing phase, and q-hierarchical conjunctive queries further allow constant-time updates. By characterizing the corresponding fragments of MATLANG, we hence identify the fragments of linear algebra programs that one can evaluate with constant-delay enumeration after linear-time preprocessing and with constant-time updates. To derive our results, we improve and generalize previous correspondences between MATLANG and relational algebra evaluated over semiring-annotated relations. In addition, we identify properties on semirings that allow to generalize the complexity bounds for free-connex and q-hierarchical conjunctive queries from Boolean annotations to general semirings.
翻译:由于线性代数和矩阵运算在数据分析中的重要性,利用关系查询优化与处理技术来评估(稀疏)线性代数程序引起了广泛兴趣。特别是近年来,线性代数程序与关系代数之间建立了紧密联系,使得后者的优化技术能够迁移至前者。本文探讨MATLANG中的哪些线性代数程序对应于合取一阶逻辑的自由连接(free-connex)片段和q-层次(q-hierarchical)片段。这两个片段均具有理想的查询处理特性:自由连接合取查询支持在线性时间预处理阶段后的恒定延迟枚举,而q-层次合取查询还进一步允许恒定时间更新。通过刻画MATLANG中的对应片段,我们识别出那些可在线性时间预处理后实现恒定延迟枚举且支持恒定时间更新的线性代数程序片段。为推导结论,我们改进并推广了MATLANG与在半环标注关系上评估的关系代数之间的现有对应关系。此外,我们识别了半环上的若干性质,使得自由连接和q-层次合取查询的复杂度界限能够从布尔标注推广至一般半环。