on the cnt\_test2 workload.[]{data-label="fig:cnt_test2"}](cnt2.PNG){width="\linewidth"}

![image](teaser.PNG){width="\linewidth"}

Cardinality Estimation Using\
Containment Rates {#Cardinality Estimation Using Containment Rates}
=============================

In this section we consider one application of the proposed containment rate estimation model: cardinality estimation. We introduce a novel approach for estimating cardinalities using query containment rates, and we show that using the proposed approach, we improve cardinality estimations significantly, especially in the case when there are multiple joins.

Since a traditional query optimizer is crucially dependent on cardinality estimation, which enables choosing among different plan alternatives by using the cardinality estimation of intermediate results within query execution plans. Therefore, the query optimizer must use reasonably good estimates. However, estimates produced by all widely-used database cardinality estimation models are routinely significantly wrong (under/over-estimated), resulting in not choosing the best plans, leading to slow executions [@HowGoodCar].

Two principal approaches for estimating cardinalities have emerged. (1) Using database profiling [@postgreSQL]. (2) Using sampling techniques [@RS1; @RS2; @IBJS]. Recently, deep learning neural networks were also used for solving this problem [@LearnedCrd; @LearnedCrd2]. However, all these approaches, with all the many attempts to improve them, have conceptually addressed the problem *directly* in the same way, as a black box, where the input is a query, and the 