RLGCNt: Cardinality Estimation Based on Rank Gauss Transform Coding and Attention
摘要
Cost and cardinality estimation play a pivotal role in determining the selection of query execution plans. However, the cardinality estimation model based on deep learning will suffer from the problem of reduced accuracy when dealing with dynamic workloads. To address the degradation of cardinality estimation under dynamic workloads, we present a novel cardinality estimation model, namely RLGCNt. For query, unevenly distributed data is rank-transformed into a normal distribution using Gaussian transform-based query encoding. This solves the problem of reduced encoding efficiency under dynamic data loads. Furthermore, we incorporate a locality-sensitive hashing module and a Gaussian kernel function module to boost cardinality estimation and capture data similarities effectively. The RLGCNt model also introduces a causal attention mechanism to address the problem of how the query data arrangement affects the cardinality estimation. We conduct a comparison between RLGCNt and deep-learning-based cardinality estimation methods on the public STATS dataset. Experimental results demonstrate that RLGCNt outperforms mainstream cardinality estimation algorithms. Specifically, for dynamic workloads in the STATS dataset, RLGCNt achieves an accuracy 10.7% higher than the baseline method, and for static loads, it attains an accuracy 5.8% higher.