# Glue: Adaptively Merging Single Table Cardinality to Estimate Join Query
Size

Rong Zhu1, Tianjing Zeng1,2, Andreas Pfadler1, Wei Chen1, Bolin Ding1, Jingren
Zhou1 1Alibaba Group, 2Renmin University of China
{red.zr, zengtianjing.ztj, andreaswernerrober, wickeychen.cw, bolin.ding,
<EMAIL_ADDRESS>
###### Abstract.

Cardinality estimation (CardEst), a central component of the query optimizer,
plays a significant role in generating high-quality query plans in DBMS. The
CardEst problem has been extensively studied in the last several decades,
using both traditional and ML-enhanced methods. Whereas, the hardest problem
in CardEst, i.e., how to estimate the join query size on multiple tables, has
not been extensively solved. Current methods either reply on independence
assumptions or apply techniques with heavy burden, whose performance is still
far from satisfactory. Even worse, existing CardEst methods are often designed
to optimize one goal, i.e., inference speed or estimation accuracy, which can
not adapt to different occasions.

In this paper, we propose a very general framework, called Glue, to tackle
with these challenges. Its key idea is to elegantly decouple the correlations
across different tables and losslessly merge single table CardEst results to
estimate the join query size. Glue supports obtaining the single table-wise
CardEst results using any existing CardEst method and can process any complex
join schema. Therefore, it easily adapts to different scenarios having
different performance requirements, i.e., OLTP with fast estimation time or
OLAP with high estimation accuracy. Meanwhile, we show that Glue can be
seamlessly integrated into the plan search process and is able to support
counting distinct number of values. All these properties exhibit the potential
advances of deploying Glue in real-world DBMS.

##  1\. Introduction

Query optimizer (QO) plays a significant important role in modern DBMSs. It is
an integral component to generate high-quality execution plans for the input
SQL queries. _Cardinality estimation( CardEst)_, which aims at estimating the
result size of all sub-plans queries, is a central part in QO. It lays the
foundation for cost estimation and guides the QO for join order selection.
Thus, CardEst has a critical impact on the quality of the generated query
plans.

Background: Due to its importance, CardEst has been extensively studied in the
literature. The core task of CardEst is to build a compact sketch capturing
the synopses of data and/or query information. Current open-source and
commercial DBMSs mainly use two traditional CardEst methods, namely histogram
(Selinger et al., 1979; Gunopulos et al., 2005; Bruno et al., 2001;
Muralikrishna and DeWitt, 1988; Wang and Sevcik, 2003; Deshpande et al., 2001)
in PostgreSQL(Documentation 12, 2020) and SQL Server(Lopes et al., 2019) and
sampling (Leis et al., 2017; Heimel et al., 2015; Kiefer et al., 2017; Zhao et
al., 2018; Li et al., 2016) in MySQL (Reference Manual, 2020) and MariaDB
(Server Documentation, 2020). Recently, with the prosperity of machine
learning (ML), there is a booming of ML-enhanced CardEst methods in the last
several years (Kipf et al., 2019; Hilprecht et al., 2019; Sun and Li, 2019;
Yang et al., 2019, 2021; Wu and Shaikhha, 2020; Zhu et al., 2021; Hasan et
al., 2020; Wu and Cong, 2021; Dutt et al., 2019; Liu et al., 2021). These
methods are either query-driven (Kipf et al., 2019; Dutt et al., 2019), which
maps featurized queries to their cardinality, or data-driven, which directly
model the joint distribution of all attributes (Yang et al., 2019, 2021;
Tzoumas et al., 2011; Getoor et al., 2001; Wu and Shaikhha, 2020; Hilprecht et
al., 2019; Zhu et al., 2021; Liu et al., 2021). They devote lots of efforts in
improving the performance of CardEst algorithms in terms of different
criteria, namely end-to-end query time (Han et al., 2022), estimation
accuracy, inference latency, updating speed and model size (Zhu et al., 2021;
Liu et al., 2021).

Challenge and Motivation: Although the estimation accuracy, as well as other
performance criteria, has been shown to be significantly improved for CardEst
methods. Some challenges still exist for CardEst algorithms. We summarize them
as follows.

First, join query size estimation, the hardcore problem of CardEst, is not
well studied yet. Due to the booming size of the join table and the existence
of cross-table correlations between attributes, the performance of existing
CardEst methods degrades with the number of join tables (Han et al., 2022).
Current CardEst methods mainly apply two kinds of approaches to process join
queries. The first one (Yang et al., 2021; Wu and Cong, 2021) directly builds
a large model on (the samples of) the full outer join table, which causes
heavy overhead and poor scalability. The second one (Hilprecht et al., 2019;
Wu and Shaikhha, 2020; Zhu et al., 2021) makes strong independence assumptions
among tables and builds an ensemble of small models on partial tables, which
needs to be tuned by experience and would more or less harm the estimation
accuracy.

Second, current CardEst methods are not adaptive to different applications.
Real-world DBMS would face different datasets and query workloads, which
emphasize different performance criteria of CardEst methods. For example, OLTP
queries require fast estimation time while OLAP queries need high estimation
accuracy (Han et al., 2022). These criteria often conflicts with each other so
it is difficult for a CardEst method to achieve both at the same time.
Moreover, even for a specific metric, different CardEst methods are suitable
for different data due to their independence assumptions. For example, SPN-
based method (Hilprecht et al., 2019) is only accurate on attributes with low
correlations. There exist no versatile CardEst method that can perform well on
any data with any query workload.

As a result, a more sophisticated and universal CardEst paradigm is still
missing, especially for the complex multi-table join queries.

Contributions: In this paper, we propose Glue, a novel CardEst framework to
tackle with these challenges. Unlike with existing CardEst methods, Glue does
not consider how to model data in each single table. Instead, it builds an
upper structure that decouples the correlations between join tables using
local independence, and then merge single table CardEst results to predict
join query size. The upper structure is conceptually independent of the
underlying models. In comparison with existing CardEst methods, Glue has the
following advantages:

1) it is very general to support any join schema, i.e. star, chain, cycle and
mixture, and join types, i.e., one-to-many and many-to-many. The upper
structure is very lightweight and easy to update. Meanwhile, Glue’s local
independence assumption is data adaptive, so its estimation error is much
lower.

2) it is very flexible to support any CardEst method on single table as plug-
ins, or even different CardEst methods for different tables in one database.
This allows the QO to steer to different optimization goals, i.e. plan quality
or throughput, and adapt to different types of data, i.e. loosely or strongly
correlated, by selecting proper CardEst methods. To the best of our knowledge,
this establish a new paradigm for CardEst.

Besides, we show that the computation process in Glue ensembles the dynamic
programming based join order selection in QO, so it can be seamlessly
integrated to speed up the plan search process. More over, we show that Glue
could also support counting distinct values. All these properties indicate
that Glue is a highly promising candidate for deploying in real-world DBMS.

Organization: In the following content, Section 2 introduces some preliminary
knowledge, Section 3 describes the main idea of Glue framework, Section 3
presents how to construct the structure in Glue, Section 4 exhibits the
distinct counting method in Glue and Section 5 concludes this paper.

##  2\. Preliminaries

In this section, we formalize the CardEst problem and brief review
representative CardEst algorithms.

###  2.1. Problem Definition

Let $T$ be a table with $k$ attributes $A=\\{A_{1},A_{2},\dots,A_{k}\\}$. $T$
could either be a single relational table or a joined table. Without
ambiguity, if $T$ is a joined table, we also use $T$ to represent the set of
all single tables joining it. In this paper, we assume that each attribute
$A_{i}$ for each $1\leq i\leq k$ to be either categorical (whose values can be
mapped to integers) or continuous, whose domain (all unique values) is denoted
as ${\sf Dom}(A_{i})$. We also denote ${\sf Dom}(T)={\sf Dom}(A_{1})\times{\sf
Dom}(A_{2})\times\dots\times{\sf Dom}(A_{k})$ to be the domain of table $T$.

Thereafter, any selection query $Q$ on $T$ can be represented in a canonical
form: $Q=\\{A_{1}\in R_{1}\wedge A_{2}\in R_{2}\wedge\cdots\wedge A_{n}\in
R_{n}\\}$, where $R_{i}\subseteq{\sf Dom}(A_{i})$ is the constraint region
specified by $Q$ over attribute $A_{i}$ (i.e. filter predicates). Without loss
of generality, we have $R_{i}={\sf Dom}(A_{i})$ if $Q$ has no constraint on
$A_{i}$. In this paper, if a region $R\subseteq{\sf Dom}(T)$ could be
decomposed into the form $R=R_{1}\times R_{2}\times\dots\times R_{k}$ where
$R_{i}\subseteq{\sf Dom}(A_{i})$ for all $i$, we call $R$ is a _regular_
region. Intuitively, a regular region is formed by a number of hyper-
rectangles in the domain space. Obviously, the query space of any selection
query $Q$ is a regular region. In the following, we use $Q$ to denote the
selection query and its region interchangeably. In this paper, we focus on
evaluating selection queries on numerical or categorical attributes. We do not
consider ‘LIKE” (or pattern matching) queries on string attributes as they
follow different technical routines.

Let ${\sf Card}(T,Q)$ denote the _cardinality_ , i.e., the exact number of
records in $T$ satisfying all constraints in $Q$. The CardEst problem requires
estimating ${\sf Card}(T,Q)$ as accurately as possible without executing $Q$
on $T$.

The CardEst problem is often interpreted and solved in a statistical
perspective. Specifically, we could regard each attribute $A_{i}$ as a random
variable defined over its domain space ${\sf Dom}(A_{i})$. Then, the set of
attributes $A$ defines a joint probability distribution function (PDF)
$\Pr_{T}(A)=\Pr_{T}(A_{1},A_{2},\dots,A_{k})$ over table $T$. Each record
$t\in T$ represents an independent tuple sampled from $\Pr_{T}(A)$.

At this time, $\Pr_{T}(Q)=\Pr_{T}(A_{1}\in R_{1},A_{2}\in R_{2},\dots,A_{k}\in
R_{k})$ represents the probability that a randomly picked record $t\in T$
satisfying the query $Q$. When the number of tuples is large enough in $T$, we
naturally have ${\sf Card}(T,Q)=\Pr_{T}(Q)\cdot|T|$. When $T$ is a join table,
e.g. $T\bowtie S$, we have ${\sf Card}(T\bowtie S,Q)=\Pr_{T\bowtie
S}(Q)\cdot|T\bowtie S|$. Since $|T|$ or $|T\bowtie S|$ is often known or can
be estimated easily, the CardEst problem is equivalent to model the joint PDF
$\Pr_{T}(A)$ and estimate the probability $\Pr_{T}(Q)$.

###  2.2. Related Work

There exist many CardEst methods in the literature, which can be classified
into three classes as follows:

_Traditional CardEst methods_, such as histogram (Selinger et al., 1979) and
sampling (Leis et al., 2017; Heimel et al., 2015; Kiefer et al., 2017), are
widely applied in DBMS and generally based on simplified assumptions and
expert-designed heuristics. Many variants of histograms (Poosala and
Ioannidis, 1997; Deshpande et al., 2001; Gunopulos et al., 2000, 2005;
Muralikrishna and DeWitt, 1988; Wang and Sevcik, 2003; Bruno et al., 2001;
Srivastava et al., 2006; Khachatryan et al., 2015; Fuchs et al., 2007;
Stillger et al., 2001; Wu et al., 2018) are proposed later to enhance their
performance. Sampling-based variants include query-driven kernel-based methods
(Heimel et al., 2015; Kiefer et al., 2017), index based methods (Leis et al.,
2017) and random walk based methods (Zhao et al., 2018; Li et al., 2016). Some
other work, such as the sketch based method (Cai et al., 2019), explores a new
direction for CardEst.

ML-based query-driven CardEst methods try to learn a model to map each
featurized query $Q$ to its cardinality ${\sf Card}(T,Q)$ directly. Some ML-
enhanced methods improve the performance of CardEst methods by using more
complex models such as DNNs (Kipf et al., 2019) or gradient boosted trees
(Dutt et al., 2019).

ML-based data-driven CardEst methods are independent of the queries. They try
to model the joint PDF $\Pr_{T}(A)$ directly so they have better
generalization ability. A variety of ML-based models have been used in
existing work to represent $\Pr_{T}(A)$, the most representative of which
includes deep auto-regression model (Yang et al., 2019, 2021; Hasan et al.,
2019) and probabilistic graphical models (PGMs) such as Bayesian networks (BN)
(Tzoumas et al., 2011; Getoor et al., 2001; Wu and Shaikhha, 2020), SPN
(Hilprecht et al., 2019), and FSPN (Zhu et al., 2021). In addition, some
methods proposed recently such as (Wu and Cong, 2021) try to integrate both
query and data information for CardEst.

##  3\. Glue Framework

In this section, we describe the details of our Glue framework. We first
formally define local independence, the foundation tool for our Glue framework
in Section 3.1, then present the main idea of Glue in Section 3.2. Finally,
Section 3.3 shows how Glue is applied to solve the CardEst problem.

(1) $\begin{split}\Pr\nolimits_{T}(Q)&=\sum_{q\in
Q}\Pr\nolimits_{T}(q_{Y})\cdot\Pr\nolimits_{T}(q_{X}|q_{Y})=\sum_{i}\sum_{q\in
Q\cap({\sf Dom}(X)\times
R_{i})}\Pr\nolimits_{T}(q_{Y})\cdot\Pr\nolimits_{T}(q_{X}|q_{Y})=\sum_{i}\sum_{q\in
Q\cap({\sf Dom}(X)\times
R_{i})}\Pr\nolimits_{T[R_{i}]}(q_{Y})\cdot\Pr\nolimits_{T[R_{i}]}(q_{X})\\\
&=\sum_{i}\left(\left(\sum_{q\in Q\cap({\sf Dom}(X)\times
R_{i})}\Pr\nolimits_{T[R_{i}]}(q_{Y})\right)\cdot\left(\sum_{q\in Q\cap({\sf
Dom}(X)\times
R_{i})}\Pr\nolimits_{T[R_{i}]}(q_{X})\right)\right)=\sum_{i}\Pr\nolimits_{T[R_{i}]}(Q_{Y})\cdot\Pr\nolimits_{T[R_{i}]}(Q_{X}\cap
R_{i}))).\end{split}$

###  3.1. Local Independence

We first introduce the concept of local independence, which serves as a
fundamental tool in our Glue framework. For any table $T$ having attributes
(random variables) $A$, let $X$ and $Y$ be a division of $A$. For any query
$Q$ on $T$, we have

(2) $\Pr\nolimits_{T}(Q)=\sum\nolimits_{q\in
Q}\Pr\nolimits_{T}(q_{Y})\cdot\Pr\nolimits_{T}(q_{X}|q_{Y}),$

where $q_{X}$ and $q_{Y}$ represent the values of the point $q$ on attributes
$X$ and $Y$, respectively. The hardness in Eq. (2) is that the term
$\Pr_{T}(q_{X}|q_{Y})$ is not independent of $q_{Y}$, i.e., the conditional
PDF $\Pr_{T}(X|y)$ differs for different value $y$ of $Y$, so the probability
over $X$ and $Y$ can not be computed and then multiplied independently. We
derive a method to decouple the correlations between $X$ and $Y$.

To compactly model the conditional PDF $\Pr(X|Y)$, we partition the domain
space ${\sf Dom}(T)={\sf Dom}(X)\times{\sf Dom}(Y)$ into multiple regions in
terms of $Y$ as ${\sf Dom}(X)\times R_{1},{\sf Dom}(X)\times R_{2},\dots,{\sf
Dom}(X)\times R_{k}$. Each $R_{i}\subseteq{\sf Dom}(Y)$ is a regular subspace
s.t. for any $y,y^{\prime}\in R_{i}$, $\Pr_{T}(X|y)=\Pr_{T}(X|y^{\prime})$
roughly holds. At this time, we only need to maintain the PDF
$\Pr_{T[R_{i}]}(X)$ for each $R_{i}$, where $T[R_{i}]$ denote the set of
tuples in $T$ existing in the space $R_{i}$. We have
$\Pr_{T}(X|y)=\Pr_{T[R_{i}]}(X)$ for any $y\in R_{i}$. We call this the
_contextual condition removal_ , where each sub-domain $R_{i}$ refers to the
context.

For each sub-space ${\sf Dom}(X)\times R_{i}$, we have
$\Pr_{T}(Y)=\Pr_{T[R_{i}]}(Y)$ when the value of $Y$ is restricted in $R_{i}$.
Let $Q_{X}$ and $Q_{Y}$ denote the space of $Q$ restricted to the domain space
of $X$ and $Y$, respectively. Then, we derive Eq. (1), which splits the
probability of $X$ and $Y$ to be independent terms in each region $Q\cap({\sf
Dom}(X)\times R_{i})$. Using this local independence, we could fast compute
the probability of query $Q$ in each region and then sum them together.

Next, we introduce the intuitive idea on how to divide the domain space to
derive local independence. In the extreme case, the local independence for
each distinct value in $Dom(T)$. In general, we could break the correlations
between variables $X$ and $Y$ to derive the local independence. As computing
the correlations of two set of variables are expensive, we could done in a
pairwise manner using a heuristic rule. Specifically, we could compute the
pairwise correlation value $s(X_{i},Y_{j})$, such as RDC score (Lopez-Paz et
al., 2013), for each pair of attributes $X_{i}\in X$ and $Y_{j}\in Y$ and
select the $Y_{j}$ maximizing $s(X_{i},Y_{j})$, i.e.
$Y_{j}=\arg\max_{j}s(X_{i},Y_{j})$. Then we could divide the domain according
to $Y_{j}$ by splitting its domain into several parts. After partition, all
tuples in the same part tend to have more similar values in terms of $Y_{j}$,
so $Y_{j}$ is not easily affected by $X$ and more likely to be locally
independent of $X$. In an extreme case, all records in the same part may have
the same value on $Y_{j}$ and obviously $Y_{j}$ is independent of $X$ in this
part. This method could be iteratively done over each part until the maximum
pairwise correlation value $s(X_{i},Y_{j})$ is lower than a threshold.

###  3.2. Overview of Glue

In this subsection, we generally introduce how Glue do CardEst on join tables
in a top-down manner. Let $W=T\bowtie S$ be a join relation where
$T=(A_{1},A_{2},\dots,A_{k})$ and $S=(B_{1},B_{2},\dots,B_{n})$ represent a
single or join relation table. For any selection query $Q$ on $T\bowtie S$,
let $Q_{T}$ and $Q_{S}$ denote the sub-query on $T$ and $S$, respectively. By
Section 2, we have ${\sf Card}(T\bowtie S,Q)=\Pr_{T\bowtie S}(Q)\cdot|T\bowtie
S|$. Glue could obtain $\Pr_{T\bowtie S}(Q)$ by merging the information from
$T$ and $S$ without building the entire model over $T\bowtie S$. We elaborate
the details as the following three main steps.

Step 1: Table decoupling. Note that, some attributes $A_{i}$ of $T$ may be
correlated with some $B_{j}$ of $S$ over $W=T\bowtie S$, which is also known
as the cross-table correlations. Therefore, we often have
$\Pr_{W}(Q)\neq\Pr_{T\bowtie S}(Q_{T})\Pr_{T\bowtie S}(Q_{S})$ on the whole
domain space of $Dom(T)\times Dom(S)$. At this time, we utilize the local
independence tool, namely _cross-table local independence_ , to decompose
$\Pr_{W}(Q)$.

Specifically, let $L_{1},L_{2},\dots,L_{t}$ be the partition of ${\sf
Dom}(T)\times{\sf Dom}(S)$ and each $L_{i}$ is in a regular form $L_{i}={\sf
Dom}(T)\times L^{1}_{i}\times L^{2}_{i}\times\dots\times L^{i}_{t}$ with
$L^{j}_{i}\subseteq{\sf Dom}(B_{j})$ for each $j$. The local independence
holds in each $L_{i}$. That is, we have

$\Pr\nolimits_{T\bowtie S}(Q\cap L_{i})=\Pr\nolimits_{W}(Q\cap
L_{i})=\Pr\nolimits_{W[L_{i}]}(Q_{T})\cdot\Pr\nolimits_{W[L_{i}]}(Q_{S}\cap
L_{i})$

for each $L_{i}$ by Eq. (1). Then, using Eq. (1), we derive

(3) $\begin{split}\Pr\nolimits_{T\bowtie
S}(Q)&=\Pr\nolimits_{W}(Q)=\sum_{i}\Pr\nolimits_{W}(Q\cap L_{i})\\\
&=\sum_{i}\Pr\nolimits_{W[L_{i}]}(Q_{T})\cdot\Pr\nolimits_{W[L_{i}]}(Q_{S}\cap
L_{i}).\end{split}$

At this time, on each $L_{i}$, we could separately compute the probability of
$Q_{T}$ and $Q_{S}\cap L_{i}$. As $Q_{T}$ and $Q_{S}\cap L_{i}$ contains no
predicates over another table, we decouple the connections across the tables
$T$ and $S$. We next show how to obtain the probability purely using the
models on $T$ and $S$, respectively.

Step 2: Local PDF correction. The probability $\Pr_{W[L_{i}]}(Q_{S}\cap
L_{i})$ contains only predicates on attributes in $S$, but it is defined over
the joint PDF of $W=T\bowtie S$ but not over $S$. We apply the idea proposed
in (Zhu et al., 2021; Hilprecht et al., 2019) to correct the PDF from $S$ to
$T\bowtie S$ using fanout(or scattering) columns. However, unlike with them,
we do not need to explicitly maintain these fanout columns but just need to
store several numbers. Let $F_{S\to T}$ denote the fanout column from table
$S$ to $T$. For any tuple $t$ in $S$, $F_{S\to T}(t)$ records how many tuples
in $T$ could join with $t$. Notably, we set $F_{S\to T}(t)=1$ if $t$ can not
join with any tuple in $T$. At this time, $t$ still occurs once (with null
attributes) in $T\bowtie S$. Then, by (Zhu et al., 2021; Hilprecht et al.,
2019), we have

(4) $\Pr\nolimits_{T\bowtie S}(Q_{S}\cap L_{i})=\frac{|S|}{|T\bowtie
S|}\cdot\sum_{f}\Pr\nolimits_{S}(Q_{S}\cap L_{i})\wedge F_{S\to T}=f)\cdot f.$

The above equation is difficult to compute directly. However, we could
simplify it again using the local independence property. We call such the
_join-key frequency independence_.

This time we divide the domain space ${\sf Dom}(S)$ to regular sub-space
$S_{1},S_{2},\dots S_{d}$ s.t. all attributes of $S$ are locally independent
of $F_{S\to T}$ in each $S_{j}$. That is, for any space $Q^{\prime}\in{\sf
Dom}(S)$, we have

$\Pr\nolimits_{S}((Q^{\prime}\cap S_{j})\wedge F_{S\to
T}=f)=\Pr\nolimits_{S[S_{j}]}(Q^{\prime}\cap
S_{j})\cdot\Pr\nolimits_{S[S_{j}]}(F_{S\to T}=f).$

Then, let $Q^{\prime}_{i}=Q_{S}\cap L_{i}$. By Eq. (1), we derive

(5) $\begin{split}&\Pr\nolimits_{T\bowtie S}(Q^{\prime}_{i})\\\
&=\frac{|S|}{|T\bowtie
S|}\cdot\sum_{j}\sum_{f}\Pr\nolimits_{S}((Q^{\prime}_{i}\cap S_{j})\wedge
F_{S\to T}=f)\cdot f\\\ &=\frac{|S|}{|T\bowtie
S|}\cdot\sum_{j}\sum_{f}\Pr\nolimits_{S[S_{j}]}(Q^{\prime}_{i}\cap
S_{j})\cdot\Pr\nolimits_{S[S_{j}]}(F_{S\to T}=f)\cdot f\\\
&=\frac{|S|}{|T\bowtie
S|}\cdot\sum_{j}\left(\Pr\nolimits_{S[S_{j}]}(Q^{\prime}_{i}\cap
S_{j})\cdot\sum_{f}\Pr\nolimits_{S[S_{j}]}(F_{S\to T}=f)\cdot f\right)\\\
&=\frac{|S|}{|T\bowtie
S|}\cdot\sum_{j}\Pr\nolimits_{S[S_{j}]}(Q^{\prime}_{i}\cap
S_{j})\cdot\mathbb{E}_{S[S_{j}]}[F_{S\to T}],\end{split}$

where $\mathbb{E}_{S[S_{j}]}[F_{S\to T}]$ denotes the expected value of
$F_{S\to T}$ restricted to all tuples of $S$ in the sub-domain $S_{j}$. We
could pre-obtain and store all these expected values. The details are
discussed later. All probabilities $\Pr\nolimits_{S[S_{j}]}(Q^{\prime}_{i}\cap
S_{j})$ could be recursively computed on table $S$. After that, we easily
obtain the probability $\Pr\nolimits_{T\bowtie S}(Q_{S}\cap L_{i})$.

In similar, for the probability $\Pr_{T\bowtie S}(Q_{T})$, we could use the
column $F_{T\to S}$ to correct the PDF from table $T$ to $T\bowtie S$. We
assume that the domain space ${\sf Dom}(T)$ are divided into regular sub-space
$T_{1},T_{2},\dots T_{m}$ s.t. all attributes of $T$ are locally independent
of $F_{T\to S}$ in each $T_{k}$. That is, for for any space $Q^{\prime}\in{\sf
Dom}(T)$, we have

$\Pr\nolimits_{T}((Q^{\prime}\cap T_{k})\wedge F_{T\to
S}=f)=\Pr\nolimits_{T[T_{k}]}(Q^{\prime}\cap
T_{k})\cdot\Pr\nolimits_{T[T_{k}]}(F_{T\to S}=f).$

We also have

(6) $\begin{split}&\Pr\nolimits_{T\bowtie S}(Q_{T})\\\ &=\frac{|T|}{|T\bowtie
S|}\cdot\sum_{k}\sum_{f}\Pr\nolimits_{T}((Q_{T}\cap T_{k})\wedge F_{T\to
S}=f)\cdot f\\\ &=\frac{|T|}{|T\bowtie
S|}\cdot\sum_{k}\sum_{f}\Pr\nolimits_{T[T_{k}]}(Q_{T}\cap
T_{k})\cdot\Pr\nolimits_{T[T_{k}]}(F_{T\to S}=f)\cdot f\\\
&=\frac{|T|}{|T\bowtie S|}\cdot\sum_{k}\left(\Pr\nolimits_{T[T_{k}]}(Q_{T}\cap
T_{k})\cdot\sum_{f}\Pr\nolimits_{T[T_{k}]}(F_{T\to S}=f)\cdot f\right)\\\
&=\frac{|T|}{|T\bowtie S|}\cdot\sum_{k}\Pr\nolimits_{T[T_{k}]}(Q_{T}\cap
T_{k})\cdot\mathbb{E}_{T[T_{k}]}[F_{T\to S}],\end{split}$

where $\mathbb{E}_{T[T_{k}]}[F_{T\to S}]$ denotes the expected value of
$F_{T\to S}$ restricted to all tuples of $T$ in the sub-domain $T_{k}$. All
probabilities $\Pr\nolimits_{T}(Q_{T}\cap T_{k})$ could be recursively
obtained on table $T$.

Using the join-key frequency local independence, we could obtain the
probability $\Pr\nolimits_{T\bowtie S}(Q_{S}\cap L_{i})$ over table $S$ for
each $i$ and $\Pr\nolimits_{T\bowtie S}(Q_{T})$ from table $T$ individually.
Putting Eq. (5) and Eq. (6) into Eq. (3), we easily obtain the probability of
$Q$ on table $T\bowtie S$.

Step 3: Recursive processing. By Step 2, we need to further obtain each
probability $\Pr\nolimits_{S}(Q^{\prime}_{i}\cap S_{j})$ from $S$ and
$\Pr\nolimits_{T}(Q_{T}\cap T_{k})$ from $T$. If $S$ (or $T$) is a single
table, the probability could be directly computed using the underlying model
of $\Pr_{S}(B_{1},B_{2},\dots,B_{n})$. In Glue, we have no limitation on how
the model is built. It could either be a simple histogram or a complex SPN
model. The probability could even be set to some magic number in some
applications. This reserves great flexibility to the underlying DBMS to choose
different CardEst algorithms to meet different requirements, i.e., much faster
for OLTP or more accurate for OLAP. Even more, Glue also allows the QO to use
different CardEst methods on different tables in a database, so users could
specify the most suitable CardEst method according to the statistical
characteristics of each table.

If $S$ (or $T$) is not a single table, we could recursively decompose its
joined tables for probability computation. Let
$\Pr\nolimits_{S}(Q^{\prime}_{S})=\Pr\nolimits_{S}(Q_{S}\cap L_{i}\cap S_{j})$
denote each query on a sub-range of $Q_{S}$ and $S=U\bowtie V$. We further
divide ${\sf Dom}(S)={\sf Dom}(U)\times{\sf Dom}(V)$ into regular sub-domains
$L^{\prime}_{1},L^{\prime}_{2},\dots,L^{\prime}_{p}$ in terms of $V$ s.t.
attributes $U$ and $V$ are independent in $L^{\prime}_{i}$, i.e., i.e., the
cross-table local independence holds. Meanwhile, we divide the domain space
${\sf Dom}(V)$ to regular sub-space $V_{1},V_{2},\dots V_{c}$ s.t. all
attributes of $V$ are locally independent of $F_{V\to U}$ in each $V_{j}$,
i.e., the join-key frequency local independence holds. After that, we need to
compute $\Pr\nolimits_{S}(Q^{\prime}_{S}\cap L^{\prime}_{i}\cap V_{j})$ for
all $1\leq i\leq p$ and $1\leq j\leq c$. The decomposition processing of table
$T$ is similar. We iterate until both $U$ and $V$ are single tables. Notice
that, we could organize all tables as a tree structure based on their
decomposition manner, where each leaf node is a single table and each inner
node is a join table. We defer the details on how to construct this
decomposition tree in next section.

###  3.3. Glue for CardEst

We show how Glue could be utilized for CardEst. We first introduce the basic
algorithm to process a single query, and then present how Glue used in the
plan search process of QO.

Basic CardEst algorithm in Glue. We present the complete algorithm Glue-
CardEst for CardEst on a single query using Glue in Figure 1. We assume that
the join tree has already been constructed offline with the root node $N$ and
push the query $Q$ onto $N$. Basically, if $N$ is a leaf node on single table,
we fetch and return the probability of $Q$ from the underlying model over $N$.
Otherwise, we fetch the cross-table local independence division conditions and
split $Q$ to $Q_{T}$ and multiple $Q_{S}\cap L_{j}$ on the left and right
child, respectively. If $Q_{T}$ (or $Q_{S}$) is empty, this indicates we have
no predicates constraints over attributes in table $T$. We directly return $1$
to be the probability of $Q_{T}$ on node $N$. Else, for both $Q_{T}$ and
$Q_{S}\cap L_{j}$, we divide it into many sub-ranges $Q^{\prime}_{T}$ and
$Q^{\prime}_{S}$ by intersecting with each $T_{k}$ and $S_{j}$, respectively.
The probability of $Q^{\prime}_{T}$ and $Q^{\prime}_{S}$ are obtained by
recursively calling Glue-CardEst on the sub-tree rooted at node $T$ and $S$,
respectively. After collecting them, we compute the probability of $Q_{T}$ and
$Q_{S}\cap L_{j}$ using Eq. (6) and Eq. (5), respectively. They are merged
together by Eq. (3) to obtain the cardinality of $Q$ on $T\bowtie S$.

Time complexity analysis. Let $h$ be the height of the decomposition tree and
$\ell$ be the maximum number of sub-space split in each node. Assume that the
probability could be obtained in $O(t)$ time on each leaf node and $O(1)$ on
each inner node. The time cost of Glue-CardEst is $O(\ell^{h}t)$ as there
exists at most $O(\ell^{h})$ sub-space to be computed. This cost is affordable
in nowdays DBMS due to the following reasons: 1) $O(t)$ is often very low on
single tables using simple models such as histogram or ML models such as SPN
(Hilprecht et al., 2019) or FSPN (Zhu et al., 2021); 2) $h$ is less than the
number of joined tables in the DBMS, which is often a small constant number.
We could also tune the tree construction method to decrease $h$; and 3) the
computation of different sub-space is easy to do in parallel.

Algorithm Glue-CardEst$(N,Q)$

1: if $N$ is a leaf node on single table $T$ then

2: return $\Pr_{T}(Q)$ from the underlying CardEst model on $T$

3: $Q_{S},Q_{T}\leftarrow Q$

4: if $Q_{T}$ is empty then

5: $\Pr\nolimits_{T\bowtie S}(Q_{T})\leftarrow 1$

6: if $Q_{S}$ is empty then

7: $\Pr\nolimits_{T\bowtie S}(Q_{S})\leftarrow 1$

8: for each $T_{k}$ of $T$ do

9: $Q^{\prime}_{T}\leftarrow Q_{T}\cap T_{k}$

10: $\Pr\nolimits_{T}(Q^{\prime}_{S})\leftarrow$ Glue-
CardEst$(T,Q^{\prime}_{T})$

11: compute $\Pr\nolimits_{T\bowtie S}(Q_{T})$ by Eq. (6)

12: for each $L_{i}$ of $S$ do

13: for each $S_{j}$ of $S$ do

14: $Q^{\prime}_{S}\leftarrow Q_{S}\cap L_{i}\cap S_{j}$

15: $\Pr\nolimits_{S}(Q^{\prime}_{S})\leftarrow$ Glue-
CardEst$(S,Q^{\prime}_{S})$

16: compute $\Pr\nolimits_{T\bowtie S}(Q_{S}\cap L_{i})$ by Eq. (5)

17: compute $\Pr\nolimits_{T\bowtie S}(Q)$ by Eq. (3)

18: return $\Pr_{T\bowtie S}(Q)\cdot|T\bowtie S|$

Figure 1. Glue-CardEst Algorithm.

Glue in Plan Search Process. Next, we show how Glue could be seamlessly used
in the plan search process. Unlike with existing CardEst methods, such as (Zhu
et al., 2021; Yang et al., 2019, 2021; Hilprecht et al., 2019), which compute
the cardinality for each sub-plan query from scratch, Glue done in a more
elegant manner. We utilize the overlaps among different sub-plan queries to
avoid redundant computation.

Given the join decomposition tree, for each node $N$, we associate it with a
set $Cd(N)$. Each element in $Cd(N)$ is a pair $(D,p)$ where $D$ is a sub-
domain space and $q$ is its probability. In the first traversal, we compute
the probability of query $Q$ itself. The domain space is recursively divided
into multiple sub-space in each node, we store each sub-space and its related
probability on each node $N$ to obtain $Cd(N)$. Next time, for any sub-plan
query $Q^{\prime}$ of $Q$, we do not need to decompose and compute the range
of $Q^{\prime}$ on the overlapped parts w.r.t. $Q$. For non-overlapped sub-
trees, which indicate $Q^{\prime}$ does not touch the tables within this sub-
tree, the sub-tree root node just returns $1$ as the probability on this
branch.

##  4\. Glue Construction

In this section, we discuss how to construct the Glue structure. We first
introduce the details on space division to derive the local independence (in
Section 4.1) and then outline the method for building join decomposition tree
(in Section 4.2).

###  4.1. Space Division Method

We present the details on how to perform the space division in cross-table and
join-key frequency local independence. We continue with the join table node
$T\bowtie S$ with the left child $T$ and right child $S$. Assume that we have
obtained the set of samples ${\sf Smp}(T),{\sf Smp}(S),{\sf Smp}(T\bowtie S)$
following the distribution of $T$, $S$ and $T\bowtie S$, respectively. Note
that ${\sf Smp}(T\bowtie S)$ is not obtained by joining ${\sf Smp}(T)$ and
${\sf Smp}(S)$ directly, which does not obey the distribution of $T\bowtie S$.
We could sample them individually using some methods such as (Zhao et al.,
2018; Li et al., 2016). In these samples, we assume that the fanout columns
$F_{S\to T}$ and $F_{T\to S}$ are given, which could be easily obtained by
scanning all sampled tuples once. Then, we derive the space division
conditions using these samples.

According to the Glue probability computation process in Section 3, the left
child node $T$ only needs to divide the domain space ${\sf Dom}(T)$ to
decouple $F_{T\to S}$with attributes $\\{A_{i}\\}$ of $T$. We could compute
the pairwise correlation value $s(A_{i},F_{T\to S})$ over ${\sf Smp}(T)$, such
as RDC score (Lopez-Paz et al., 2013), between each attribute $A_{i}$ of $T$
and $F_{T\to S}$. If some attributes $A_{i}$ are highly correlated with
$F_{T\to S}$, i.e., $s(A_{i},F_{T\to S})$ is larger than a threshold, we could
randomly split the domain ${\sf Dom}(A_{i})$ into several parts. This could be
done for an evenly splitting of continuous attributes or randomly assignment
of categorical attributes. Intuitively, after division, all tuples in the same
part tends to have similar values in terms of $A_{i}$, so $A_{i}$ is not
easily affected by $F_{T\to S}$ and more likely to be mutually independent. We
iterate this process until all attributes $A_{i}$ are not highly correlated
with $F_{T\to S}$. After that, for each divided domain $T_{k}$, we compute the
estimated value $\widehat{\mathbb{E}}_{T[T_{k}]}[F_{T\to S}]$ of $F_{T\to S}$
over ${\sf Smp}(T)$ and store it for probability computation.

Similarly, for the right child $S$, we first compute the pairwise correlations
between $s(A_{i},B_{j})$ over ${\sf Smp}(T\bowtie S)$, select an attribute
$B_{j}$ maximizing the score $s(A_{i},B_{j})$ and perform the space division.
After that, we once again divide ${\sf Dom}(S)$ over ${\sf Smp}(S)$ to
decouple $\\{B_{j}\\}$ with $F_{S\to T}$. As these division conditions are all
over ${\sf Dom}(S)$, we could merge them together afterwards. Sometimes, the
two division steps over $S$ could also be do altogether, i.e., we choose to
divide the attribute $B_{j}$ maximizes $\min(s(A_{i},B_{j}),s(B_{j},F_{S\to
T}))$ each time. After computation, we also compute and store the estimated
value $\widehat{\mathbb{E}}_{S[S_{j}]}[F_{S\to T}]$ of $F_{S\to T}$ over ${\sf
Smp}(S)$ for each region $S_{k}$.

It is worth mentioning that our division strategy is only a heuristic rule,
which has been shown to perform well in (Zhu et al., 2021). Essentially, Glue
is open for any space division method, such as grid-based clustering, as long
as it could generate regular sub-space. Finding the suitable division method
would be application-aware and an interesting future research work.

###  4.2. Join Decomposition Tree

On a higher perspective, Glue is able to support any join schema, including
but not limited to chain join, star join, cyclic join and self-join between
tables and the complex mixture of them. We model the join schema graph among
tables in a database as a graph $\mathcal{G}=(\mathcal{V},\mathcal{E})$, where
each node $T\in\mathcal{V}$ is a single relation table and each edge
$(T,S)\in\mathcal{E}$ indicating $T$ could join with $S$. Each join relation
could be: 1) an inner join, as we explained the main idea of Glue in Section
3, or outer, left or right join; 2) a one-to-many PK-FK join or a many-to-many
FK-FK join; and 3) an equal join or even unequal join.

A decomposition tree $\mathcal{T}$ is valid if and only if: 1) the root node
is full join of all tables in $\mathcal{V}$; 2) each inner node $N$ splitting
its join table $S\bowtie T$ to left child $S$ and right child $T$ s.t. tables
in $S$ and $T$ form connected components in $\mathcal{G}$ with internal join
edges; and 3) each leaf node corresponds to a single table in $\mathcal{V}$.
Obviously, each decomposition tree corresponds to a plan tree for a query
touching all tables in $\mathcal{V}$. Therefore, it could be generated using a
similar method for plan generation.

In general, we could apply a dynamic programming method to construct the tree
$\mathcal{T}$. Each time on a node $N$, we split its tables to $S$ joining
with $T$ such that this decomposition minimizes $Cost(S)+Cost(T)+Cost(S,T)$.
Here $Cost(S)$ (or $Cost(T)$) defines the recursively defined cost in terms of
CardEst task over underlying node $S$ (or $T$). $Cost(S,T)$ describes the cost
for combining $S$ and $T$ together. Unlike with the plan generation with a
specified cost model, the case for our CardEst is a bit more complex. The cost
model needs to consider the following aspects:

1) the sampling cost. As stated in Section 3.1, we need to apply samples on
$T$, $S$ and $T\bowtie S$ to obtain the division conditions and expected
value. Obviously, the sampling could be done easily when $T$ or $S$ contains
less number of tables. For example, if we restrict $S$ to be a single table
each time, in similar to the left-deep plan restriction, we could easily
obtain the samples on $T\bowtie S$ by sampling tuples in $S$ w.r.t. samples in
$T$ using Olken’s sampling algorithm. If $T$ or $S$ contains multiple tables,
we may need to sample for $T\bowtie S$ individually and can not reuse the
existing samples. We could measure this by $\min(||S||,||T||)$, where $||T||$
denote the number of tables in $T$.

2) the error cost. The correlations between different pairs of $T$ and $S$ are
different, so as the decomposition error. Intuitively, the smaller the
correlation scores between $T$ and $S$, the easier of the local independence
exists. We could measure this by $s(T,S)=\max_{i,j}(s(A_{i},B_{j}))$ where
$s(A_{i},B_{j})$ is the correlation score between attributes $A_{i}$ of $T$
and $B_{j}$ of $S$.

3) the inference cost. By the time complexity analysis in Section 3.2, the
inference cost is determined by the tree height $h$ and sub-space division
number $l$. Obviously, $h$ is lower when $T$ and $S$ have balanced number of
tables, and $l$ is lower when the correlations between $T$ and $S$ have higher
correlations. Therefore, we could measure this by
$s(T,S)^{\max(||S||,||T||)}$.

4) the modeling cost. This refers to the base cost of building CardEst methods
on each single table $T$. We denote it as a function $g(T)$, which is related
to the structure learning time complexity of the underlying CardEst algorithm.
For histogram, it is linear w.r.t. the number of attributes in $T$. For
SPN/FSPN and BN, it is polynomial and exponential w.r.t. the number of
attributes in $T$, respectively.

Putting them together, we obtain the following cost model function

(7) $\begin{split}Cost(S\bowtie T)&=\alpha\min(||S||,||T||)+\beta s(T,S)\\\
&+\gamma s(T,S)^{\max(||S||,||T||)}+Cost(S)+Cost(T),\\\
Cost(T)&=g(T),\end{split}$

where $\alpha$, $\beta$ and $\gamma$ are all hyper-parameters tuning the
weights of each part. Some aspects, such as the sampling cost and inference
cost, are conflict with each other. We could emphasize different parts in
different scenarios, e.g., fast inference for OLTP or low error for OLAP. Note
that, we measure each aspect using the most straightforward metric. Glue is
open for any complex cost model and it is also an interesting future research
work.

Using Eq. (7), we could apply the dynamic programming method to construct the
decomposition tree. The procedures are similar to plan generation. We omit it
for simplicity. We could also apply some heuristic rules, such as greedy
search, to find near-optimal result. Moreover, we do not restrict to build
only one join decomposition tree for a database. We could build each for each
frequently occurred join schema in the query workload.

Model update. Conceptually, the join decomposition tree is independent of the
underlying models on single tables. Thus, they could be updated individually.
When data changes on some tables, the corresponding CardEst models are updated
accordingly. For the join decomposition tree, it is more robust for data
changes. We could periodically examine whether the local independence still
holds in each sub-space. If not, we re-split the sub-space accordingly.

##  5\. Glue for Distinct Count

In this section, we discuss how to adapt Glue to count distinct number of
values, which is frequently occurred in SQL queries with distinct predicate.
We first show how to adapt existing CardEst model to support distinct count on
single table, and then how the framework in Glue could support join queries.

Following Section 2, from a statistical perspective, the distinct count of
query $Q$ on table $T$ could de defined as ${\sf Dis}(T,Q)=|\\{q\in
Q|\Pr_{T}(q)>0\\}|$. That is, each point $q$ that can occur in the space of
$Q$ is counted exactly once. Recall that, $T$ could be either single
relational table or join table. In traditional methods, histogram and multiple
sampling-based CardEst methods could be used to count distinct number of
values. For ML-based methods, we find that the SPN model (Poon and Domingos,
2011) and FSPN model (Wu et al., 2020) could also support distinct count with
small adaptions. We elaborate the details as follows.

Distinct count on single table. For the SPN model, it models the joint PDF
$Pr_{T}(A_{1},A_{2},\dots,A_{k})$ using sum and product operations. Each sum
node decomposes the joint PDF into weight sum of smaller models and each
product node find local independence among different groups of attributes.
Each leaf node in SPN maintains a histogram over a singleton attribute on some
data.The distinct count could be done in similar to its probability inference
as follows:

1) on leaf node modeling $Pr_{T^{\prime}}(A_{i})$, we easily obtain ${\sf
Dis}(T^{\prime},Q_{i})$ by scanning the histogram of $A_{i}$ in $Q_{i}$’s
range and send it to its father node.

2) on sum node modeling
$Pr_{T}(A^{\prime})=\sum_{i}w_{i}Pr_{T_{i}}(A^{\prime})$, we restrict that
each sum node divides the domain space into non-overlapping regular sub-space
and each $T_{i}$ contains all tuples in a sub-space. As a results, we easily
sum ${\sf Dis}(T,Q^{\prime})=\sum_{i}{\sf Dis}(T_{i},Q^{\prime})$ from all
children.

3) on product node modeling
$Pr_{T^{\prime}}(A^{\prime})=\prod_{j}Pr_{T^{\prime}}(A^{\prime}_{j})$, since
$A^{\prime}_{j}$ are all mutually independent, we know
$Pr_{T^{\prime}}(A^{\prime})>0$ if and only if
$Pr_{T^{\prime}}(A^{\prime}_{j})>0$ for all $j$. That is, each distinct value
of $A^{\prime}$ must be counted in each $A_{j}$. Therefore, we easily have
${\sf Dis}(T^{\prime},Q_{A^{\prime}})=\prod_{j}{\sf
Dis}(T^{\prime},Q_{A^{\prime}_{j}})$.

The distinct count on SPN is the same as probability inference, which is
linear w.r.t. its node size. For FSPN, the method is similar as long as we
count and add the distinct number in each sub-space specified by its factorize
and split nodes.

Distinct count in Glue. Following the local independence space decomposition
in Section 3.2, the distinct counting in Glue is also straightforward. First,
Eq. (3) split the range of $Q$ to $Q_{T}$ and each $Q_{S}\cap L_{j}$. Due to
the cross-table local independence, we obtain

(8) ${\sf Dis}(T\bowtie S,Q)=\sum_{i}{\sf Dis}(T\bowtie S,Q_{T})\cdot{\sf
Dis}(T\bowtie S,Q_{S}\cap L_{i}).$

For ${\sf Dis}(T\bowtie S,Q_{T})$, we could obtain it from the joint PDF over
$T$. By Eq. (6), we have

(9) ${\sf Dis}(T\bowtie S,Q_{T})=\sum_{k}\begin{cases}{\sf Dis}(T,Q_{T}\cap
T_{k}),&\text{if }\mathbb{E}_{T[T_{k}]}[F_{T\to S}]>0;\\\ 0,&\text{if
}\mathbb{E}_{T[T_{k}]}[F_{T\to S}]=0.\end{cases}$

This is because in the sub-domain of each $T_{k}$, all attributes of $T$ are
independent of $F_{T\to S}$ due to join-key frequency local independence.
$\mathbb{E}_{T[T_{k}]}[F_{T\to S}]=0.$ indicates $\Pr_{T}(Q_{T}\wedge F_{T\to
S}=f)=0$ for all $f$, so no values in this sub-domain would be scattered from
$T$ to $T\bowtie S$. Otherwise, $\mathbb{E}_{T[T_{k}]}[F_{T\to S}]>0$
indicates $\Pr_{T}(Q_{T}\wedge F_{T\to S}=f)>0$ for some $f$, so a value in
$Q_{T}$ would occur in $T\bowtie S$ as long as it occurs in $T$. For each
${\sf Dis}(T,Q_{T}\cap T_{k})$, it could be recursively obtained from table
$T$. If $T$ is a single table, we return the distinct count value using the
algorithm on single table.

Similarly, for each ${\sf Dis}(T\bowtie S,Q_{S}\cap L_{i})$, by Eq. (5), we
have

(10) $\begin{split}&{\sf Dis}(T\bowtie S,Q_{S}\cap L_{i})\\\
&=\sum_{j}\begin{cases}{\sf Dis}(S,Q_{S}\cap L_{i}\cap S_{j}),&\text{if
}\mathbb{E}_{S[S_{j}]}[F_{S\to T}]>0;\\\ 0,&\text{if
}\mathbb{E}_{S[S_{j}]}[F_{S\to T}]=0,\end{cases}\end{split}$

where each ${\sf Dis}(S,Q_{S}\cap L_{i}\cap S_{j})$ could be recursively
obtained from table $S$.

As a result, we could use the same framework of Glue-CardEst for CardEst to
count distinct value with some small modifications: 1) replacing Eq. (3), Eq.
(5) and Eq. (6) to Eq. (8), Eq. (10) and Eq. (9), respectively; and 2) in the
base case, returning the distinct count value over a single table.

##  6\. Conclusions

We propose Glue, a general CardEst framework that is able to merge single
table CardEst results to predict join query size. Glue is flexible to support
any underlying CardEst method on single table and could steer to optimize
different criteria. It is more flexible and adaptive to different datasets and
query workloads, thus more suitable for deployment in real-world DBMS.

## References

  * (1)
  * Bruno et al. (2001) Nicolas Bruno, Surajit Chaudhuri, and Luis Gravano. 2001\.  STHoles: a multidimensional workload-aware histogram. In _SIGMOD_. 211–222.
  * Cai et al. (2019) Walter Cai, Magdalena Balazinska, and Dan Suciu. 2019\.  Pessimistic cardinality estimation: Tighter upper bounds for intermediate join cardinalities. In _SIGMOD_. 18–35.
  * Deshpande et al. (2001) Amol Deshpande, Minos Garofalakis, and Rajeev Rastogi. 2001\.  Independence is good: Dependency-based histogram synopses for high-dimensional data.  _ACM SIGMOD Record_ 30, 2 (2001), 199–210.
  * Documentation 12 (2020) Postgresql Documentation 12. 2020\.  Chapter 70.1. Row Estimation Examples.  _https://www.postgresql.org/docs/current/row-estimation-examples.html_ (2020).
  * Dutt et al. (2019) Anshuman Dutt, Chi Wang, Azade Nazi, Srikanth Kandula, Vivek Narasayya, and Surajit Chaudhuri. 2019.  Selectivity estimation for range predicates using lightweight models.  _PVLDB_ 12, 9 (2019), 1044–1057.
  * Fuchs et al. (2007) Dennis Fuchs, Zhen He, and Byung Suk Lee. 2007.  Compressed histograms with arbitrary bucket layouts for selectivity estimation.  _Information Sciences_ 177, 3 (2007), 680–702.
  * Getoor et al. (2001) Lise Getoor, Benjamin Taskar, and Daphne Koller. 2001\.  Selectivity estimation using probabilistic models. In _SIGMOD_. 461–472.
  * Gunopulos et al. (2000) Dimitrios Gunopulos, George Kollios, Vassilis J Tsotras, and Carlotta Domeniconi. 2000.  Approximating multi-dimensional aggregate range queries over real attributes. In _SIGMOD_. 463–474.
  * Gunopulos et al. (2005) Dimitrios Gunopulos, George Kollios, Vassilis J Tsotras, and Carlotta Domeniconi. 2005.  Selectivity estimators for multidimensional range queries over real attributes.  _The VLDB Journal_ 14, 2 (2005), 137–154.
  * Han et al. (2022) Yuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu, Jingyi Yang, Tan Wei Liang, Kai Zeng, Gao Cong, Yanzhao Qin, Andreas Pfadler, Zhengping Qian, Jingren Zhou, Jiangneng Li, and Bin Cui. 2022\.  Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation.  _VLDB_ (2022).
  * Hasan et al. (2019) Shohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas, and Gautam Das. 2019\.  Multi-attribute selectivity estimation using deep learning. In _SIGMOD_.
  * Hasan et al. (2020) Shohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas, and Gautam Das. 2020\.  Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries. In _Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data_. 1035–1050.
  * Heimel et al. (2015) Max Heimel, Martin Kiefer, and Volker Markl. 2015\.  Self-tuning, gpu-accelerated kernel density models for multidimensional selectivity estimation. In _SIGMOD_. 1477–1492.
  * Hilprecht et al. (2019) Benjamin Hilprecht, Andreas Schmidt, Moritz Kulessa, Alejandro Molina, Kristian Kersting, and Carsten Binnig. 2019.  DeepDB: learn from data, not from queries!. In _PVLDB_.
  * Khachatryan et al. (2015) Andranik Khachatryan, Emmanuel Müller, Christian Stier, and Klemens Böhm. 2015.  Improving accuracy and robustness of self-tuning histograms by subspace clustering.  _IEEE TKDE_ 27, 9 (2015), 2377–2389.
  * Kiefer et al. (2017) Martin Kiefer, Max Heimel, Sebastian Breß, and Volker Markl. 2017.  Estimating join selectivities using bandwidth-optimized kernel density models.  _PVLDB_ 10, 13 (2017), 2085–2096.
  * Kipf et al. (2019) Andreas Kipf, Thomas Kipf, Bernhard Radke, Viktor Leis, Peter Boncz, and Alfons Kemper. 2019\.  Learned cardinalities: Estimating correlated joins with deep learning. In _CIDR_.
  * Leis et al. (2017) Viktor Leis, Bernhard Radke, Andrey Gubichev, Alfons Kemper, and Thomas Neumann. 2017.  Cardinality Estimation Done Right: Index-Based Join Sampling. In _CIDR_.
  * Li et al. (2016) Feifei Li, Bin Wu, Ke Yi, and Zhuoyue Zhao. 2016\.  Wander join: Online aggregation via random walks. In _SIGMOD_. 615–629.
  * Liu et al. (2021) Jie Liu, Wenqian Dong, Qingqing Zhou, and Dong Li. 2021\.  Fauce: fast and accurate deep ensembles with uncertainty for cardinality estimation.  _Proceedings of the VLDB Endowment_ 14, 11 (2021), 1950–1963.
  * Lopes et al. (2019) Pedro Lopes, Craig Guyer, and Milener Gene. 2019.  Sql docs: cardinality estimation (SQL Server).  _https://docs.microsoft.com/en-us/sql/relational-databases/performance/cardinality-estimation-sql-server?view=sql-server-ver15_ (2019).
  * Lopez-Paz et al. (2013) David Lopez-Paz, Philipp Hennig, and Bernhard Schölkopf. 2013\.  The randomized dependence coefficient. In _NIPS_. 1–9.
  * Muralikrishna and DeWitt (1988) M Muralikrishna and David J DeWitt. 1988.  Equi-depth multidimensional histograms. In _Proceedings of the 1988 ACM SIGMOD international conference on Management of data_. 28–36.
  * Poon and Domingos (2011) Hoifung Poon and Pedro Domingos. 2011.  Sum-product networks: A new deep architecture. In _ICCV Workshops_. 689–690.
  * Poosala and Ioannidis (1997) Viswanath Poosala and Yannis E Ioannidis. 1997.  Selectivity estimation without the attribute value independence assumption. In _VLDB_ , Vol. 97. 486–495.
  * Reference Manual (2020) MySQL 8.0 Reference Manual. 2020\.  Chapter 15.8.10.2 Configuring Non-Persistent Optimizer Statistics Parameters.  _https://dev.mysql.com/doc/refman/8.0/en/innodb-statistics-estimation.html_ (2020).
  * Selinger et al. (1979) P Griffiths Selinger, Morton M Astrahan, Donald D Chamberlin, Raymond A Lorie, and Thomas G Price. 1979\.  Access path selection in a relational database management system. In _SIGMOD_. 23–34.
  * Server Documentation (2020) MariaDB Server Documentation. 2020\.  Statistics for optimizing queries: InnoDB persistent statistics.  _https://mariadb.com/kb/en/innodb-persistent-statistics/_ (2020).
  * Srivastava et al. (2006) Utkarsh Srivastava, Peter J Haas, Volker Markl, Marcel Kutsch, and Tam Minh Tran. 2006\.  Isomer: Consistent histogram construction using query feedback. In _ICDE_. 39–39.
  * Stillger et al. (2001) Michael Stillger, Guy M Lohman, Volker Markl, and Mokhtar Kandil. 2001.  LEO-DB2’s learning optimizer. In _PVLDB_ , Vol. 1. 19–28.
  * Sun and Li (2019) Ji Sun and Guoliang Li. 2019.  An end-to-end learning-based cost estimator.  _VLDB_ (2019).
  * Tzoumas et al. (2011) Kostas Tzoumas, Amol Deshpande, and Christian S Jensen. 2011\.  Lightweight graphical models for selectivity estimation without independence assumptions.  _PVLDB_ 4, 11 (2011), 852–863.
  * Wang and Sevcik (2003) Hai Wang and Kenneth C Sevcik. 2003.  A multi-dimensional histogram for selectivity estimation and fast approximate query answering. In _Proceedings of the 2003 conference of the Centre for Advanced Studies on Collaborative research_. 328–342.
  * Wu et al. (2018) Chenggang Wu, Alekh Jindal, Saeed Amizadeh, Hiren Patel, Wangchao Le, Shi Qiao, and Sriram Rao. 2018.  Towards a learning optimizer for shared clouds.  _PVLDB_ 12, 3 (2018), 210–222.
  * Wu and Cong (2021) Peizhi Wu and Gao Cong. 2021.  A Unified Deep Model of Learning from both Data and Queries for Cardinality Estimation. In _Proceedings of the 2021 ACM SIGMOD International Conference on Management of Data_.
  * Wu and Shaikhha (2020) Ziniu Wu and Amir Shaikhha. 2020.  BayesCard: A Unified Bayesian Framework for Cardinality Estimation.  _arXiv preprint arXiv:2012.14743_ (2020).
  * Wu et al. (2021) Ziniu Wu, Peilun Yang, Pei Yu, Rong Zhu, Yuxing Han, Yaliang Li, Defu Lian, Kai Zeng, and Jingren Zhou. 2021\.  A Unified Transferable Model for ML-Enhanced DBMS.  _arXiv preprint arXiv:2105.02418_ (2021).
  * Wu et al. (2020) Ziniu Wu, Rong Zhu, Andreas Pfadler, Yuxing Han, Jiangneng Li, Zhengping Qian, Kai Zeng, and Jingren Zhou. 2020\.  FSPN: A New Class of Probabilistic Graphical Model.  _arXiv preprint arXiv:2011.09020_ (2020).
  * Yang et al. (2021) Zongheng Yang, Amog Kamsetty, Sifei Luan, Eric Liang, Yan Duan, Xi Chen, and Ion Stoica. 2021.  NeuroCard: One Cardinality Estimator for All Tables.  _PVLDB_ 14, 1 (2021), 61–73.
  * Yang et al. (2019) Zongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu, Yan Duan, Xi Chen, Pieter Abbeel, Joseph M Hellerstein, Sanjay Krishnan, and Ion Stoica. 2019\.  Deep unsupervised cardinality estimation.  _PVLDB_ (2019).
  * Zhao et al. (2018) Zhuoyue Zhao, Robert Christensen, Feifei Li, Xiao Hu, and Ke Yi. 2018.  Random sampling over joins revisited. In _SIGMOD_. 1525–1539.
  * Zhu et al. (2021) Rong Zhu, Ziniu Wu, Yuxing Han, Kai Zeng, Andreas Pfadler, Zhengping Qian, Jingren Zhou, and Bin Cui. 2021\.  FLAT: Fast, Lightweight and Accurate Method for Cardinality Estimation.  _VLDB_ 14, 9 (2021), 1489–1502.


# Carbon-12 in the generalized Skyrme model

Christoph Adam  Departamento de Física de Partículas, Universidad de Santiago
de Compostela and Instituto Galego de Física de Altas Enerxias (IGFAE)
Santiago de Compostela, E-15782, Spain  Carlos Naya  Institute of Theoretical
Physics, Jagiellonian University, Lojasiewicza 11, 30-348 Kraków, Poland
Department of Physics, Stockholm University, AlbaNova University Center, 106
91, Stockholm, Sweden  Andrzej Wereszczyński  Institute of Theoretical
Physics, Jagiellonian University, Lojasiewicza 11, 30-348 Kraków, Poland
Department of Applied Mathematics, University of Salamanca, Casas del Parque 2
and Institute of Fundamental Physics and Mathematics, University of Salamanca,
Plaza de la Merced 1, 37008 - Salamanca, Spain  International Institute for
Sustainability with Knotted Chiral Meta Matter (WPI-SKCM2), Hiroshima
University, Higashi-Hiroshima, Hiroshima 739-8526, Japan

###### Abstract

We study properties of the 12C nucleus within the generalized Skyrme model
where, in addition to the standard massive Skyrme model, the sextic term and
the pionic potential squared are included. We find that the model continues to
accurately describe the rotational bands of the 12C nucleus. In addition, at
variance with the case of the standard Skyrme model, it provides the correct
energy ordering of the classical solutions which correspond to the ground
state and the Hoyle state, respectively.

##  I Motivation

The Skyrme model Skyrme , in principle, allows for a unified field theoretical
description of baryonic matter at all scales - from single baryons to infinite
nuclear matter HS-book ; MR-book ; NM-book . Specifically, the description of
atomic nuclei in the Skyrme model framework is based on Skyrmions i.e.,
classical topological soliton solutions of the model, where their topological
charge $B$ can be rigorously identified with the baryon number. Further
quantum numbers of nuclei, like spin and isospin, are described by the
semiclassical quantization of Skyrmions, i.e., the quantization of the
lightest collective degrees of freedom of the classical solutions, like the
zero modes (the classical symmetries) ANW  or the vibrational modes (massive
deformations) H-1 .

Until about a decade ago, most calculations within this framework were
restricted to the standard Skyrme model (to be defined below) and to the
semiclassical quantization of the zero modes, the so-called rigid rotor
quantization. Amongst the successes of this approach, let us mention the very
good description of the excitation bands of several light atomic nuclei
Manko2007 ; Battye2009 . Nevertheless, for other nuclei, particularly the ones
with an odd baryon number $B$, the nuclear spectra are not reproduced
correctly, indicating that probably both generalized versions of the Skyrme
model and a more refined quantization procedure are required.

Indeed, the implementation of the vibrational quantization H-1 , that is, the
inclusion of the massive modes, led to spectacular results for the nuclei 7Li
H-1  and 16O H-2 ; H-3 . Also 12C found an elegant and quite accurate
description within the Skyrme model. The Carbon-12 nucleus is known to exist
in two spin zero states: the ground state and the slightly heavier Hoyle state
Hoyle . Both give rise to excitation bands with different slopes. The Skyrme
model provides a very elegant explanation of these facts Lau2014 . For the
$B=12$ Skyrmion, there are two geometrically distinct classical solutions
related to a different organization of the $B=4$ ($\alpha$ particle)
substructures Battye2007 ; Rawlinson2018 . The first one has the $D_{3h}$
symmetry, where three $B=4$ Skyrmions are arranged into a triangular shape.
The second one, with the $D_{4h}$ symmetry, is a straight chain of $B=4$
Skyrmions. Different shapes of the classical solutions result in unequal spin
inertial tensors and, as a consequence, lead to different slopes of the
excitation bands, which agree with the experimentally measured ones to a very
good precision. In fact, this is the Skyrme model realization of the
$\alpha$-particle clustering model of light nuclei.

There has been, however, one issue with the Skyrme model computation. The
triangular Skyrmion has slightly higher energy than the chain solution. Thus,
while the slopes were correct, the energy ordering of the states did not agree
with the experimental data.

In the present paper, we show that a certain generalization of the Skyrme
model gives the correct order of the ground and Hoyle states, while keeping
simultaneously the slopes of the excitation bands close to the experimental
values. This is achieved by the inclusion of the so-called BPS part BPS ,
which combines a term which is sextic in first derivatives sextic  and a new
potential term BG-0 ; BG-1 ; BG-2 .

##  II Landscape of classical Skyrmions

The static energy functional of the generalized Skyrme model which we consider
in the present paper reads

$\displaystyle E$ $\displaystyle=$ $\displaystyle E_{Sk}+E_{BPS}=$ (1)
$\displaystyle=$
$\displaystyle\int\left(-\frac{f_{\pi}^{2}}{4}\mbox{Tr}\left(R_{i}R_{i}\right)-\frac{1}{32e^{2}}\mbox{Tr}\left[R_{i},R_{j}\right]^{2}-\frac{1}{8}m_{\pi}^{2}f_{\pi}^{2}\mbox{Tr}\left(1-U\right)\right)d^{3}x$
$\displaystyle+$
$\displaystyle\int\left(4\pi^{4}\lambda^{2}\mathcal{B}^{2}+\frac{M^{2}_{2}}{4}\left[\mbox{Tr}\left(1-U\right)\right]^{2}\right)d^{3}x,$

with $f_{\pi}$ the pion decay constant, $m_{\pi}$ the pions mass, and $e$,
$\lambda$ and $M_{2}$ some coupling parameters. Besides,
$R_{i}=\partial_{i}UU^{\dagger}$ is the right invariant current of the $SU(2)$
valued matrix Skyrme field $U(\boldsymbol{x})$. In order to have finite energy
solutions the field must take a constant value at infinity, in particular,
$U(|\boldsymbol{x}|\rightarrow\infty)=1$, allowing us to compactify the base
space $\mathbb{R}^{3}$ into $S^{3}$. Hence,

$\mathcal{B}=-\frac{1}{24\pi^{2}}\epsilon_{ijk}\mbox{Tr}\left(R_{i}R_{j}R_{k}\right)$
(2)

is the baryon charge density whose volume integral gives the topological
baryon charge $B$.

In comparison with the original Skyrme proposal, which we call the massive
Skyrme model $E_{Sk}$, it has an additional contribution from the so-called
BPS Skyrme model $E_{BPS}$ BPS , which contains two additional terms. Namely,
the baryonic density squared term (referred to as the sextic term sextic ) and
the pion potential squared term BG-0 ; BG-1 ; BG-2 . It is important to note
that this new non-derivative part does not influence the small field expansion
and, therefore, it does not change the pion mass, $m_{\pi}$.

The original motivation to include the BPS model is related to the fact that
the model $E_{Sk}$ leads to rather large classical binding energies, which are
much larger than the binding energies of physical nuclei. The BPS model alone
has zero classical binding energies BPS , therefore its inclusion should
ameliorate this problem. Later it was found that a new potential term (the
fourth power of the pion mass potential) serves to reduce binding energies by
itself DH , MS . This observation was generalized to other types of potential
(e.g., the square of the pion mass potential) with or without the presence of
the sextic term BG-0 ; BG-1 ; BG-2 . The sextic term is, however,
indispensable for a realistic description of nuclear matter at high densities,
because without it the resulting nuclear matter equation of state turns out
much too soft Sk-EOS .

For convenience, we can define the energy and length units, allowing us to
write a dimensionless static energy functional depending only on three
coupling constants instead of five. We will choose to keep the coefficients of
the kinetic term and the pion mass potential fixed. To this purpose, we
rewrite the $e$ coupling constant as follows, $e^{2}\rightarrow e^{2}/c_{4}$
and introduce the usual choice of Skyrme units

$l=\frac{2}{ef_{\pi}},\;\;\;E_{0}=\frac{f_{\pi}}{4e}.$ (3)

Hence, the static energy functional of the generalized Skyrme model reads now

$\displaystyle E$ $\displaystyle=$
$\displaystyle\frac{1}{12\pi^{2}}\int\left(-\frac{1}{2}\mbox{Tr}\left(R_{i}R_{i}\right)-\frac{c_{4}}{16}\mbox{Tr}\left[R_{i},R_{j}\right]^{2}+m^{2}\mbox{Tr}\left(1-U\right)\right)d^{3}x$
(4) $\displaystyle+$
$\displaystyle\frac{1}{12\pi^{2}}\int\left(4\pi^{4}c_{6}\mathcal{B}^{2}+\frac{m^{2}_{2}}{4}\left[\mbox{Tr}\left(1-U\right)\right]^{2}\right)d^{3}x,$

where the mass parameter $m$ is related to the physical pion mass $m_{\pi}$ as

$m=\frac{2m_{\pi}}{ef_{\pi}},$ (5)

while the relation of the new coupling constants $c_{6}$ and $m_{2}$ with the
previous ones is not important. Furthermore, we have normalized the total
energy by a factor $1/12\pi^{2}$ which, together with the Faddeev-Skyrme BPS
bound F , implies that $E_{Sk}\geq\sqrt{c_{4}}|B|$. The model contains now
three tunable parameters $c_{4},c_{6}$ and $m_{2}$, which are the couplings of
the quartic Skyrme term, the sextic term and the additional potential,
respectivley The pion mass parameter is assumed to be $m=0.526$, which
provides the physical mass of the pions if the standard calibration of the
model $E_{Sk}$ is chosen.

As we already noticed, in the massive Skyrme model (where $c_{6}=m_{2}=0$),
the $B=12$ chain Skyrmion has lower energy than the triangle solution. In our
numerical analysis we varied $c_{4},c_{6}$ and $m_{2}$ in a search for a
region where:

  1. i)

the $D_{3h}$ and $D_{4h}$ Skyrmions, with a well pronounced $\alpha$-particle
clustering structure, are stable critical point of the energy functional and

  2. ii)

the triangular solution with $D_{3h}$ symmetry has lower energy that the chain
solution.

In this process, we have minimised the energy functional for different values
of the coupling constants and initial conditions using the same numerical
scheme as in Naya2018 . In summary, this consists in evolving the system
through second-order-in-time equations derived from a Lagrangian with the
static contribution given by Eq. (4) in a cubic grid with boundary condition
$U=1$. Spatial derivatives are approximated by fourth-order finite differences
and the time evolution is carried out by a fourth-order Runge-Kutta method.
For the system to flow to the minimal configuration, the motion is immediately
frozen by setting the time derivatives to zero when the static energy
increases before continuing the further evolution. During the general scanning
of the parameter space, we have considered a lattice of $100^{3}$ points with
spacing $\Delta x=0.15$ and time step $\Delta t=0.08$.

After an exhaustive sweeping of the coupling constants, we have found an
optimal set of values where the coefficients of the quartic and sextic
contributions are equal to one, $c_{4}=c_{6}=1$, while $m_{2}\geq 0.5$. For
smaller values of $m_{2}$ we do not find the $D_{3h}$ soliton, even if we
started with a suitable initial configuration. In this case we arrive at the
configuration with $C_{3v}$ symmetry described in Battye2006 . This seems to
indicate that for $m_{2}\lesssim 0.5$ the desired Skyrmion describing the
carbon-12 ground state is a saddle point solution. For the same set of
parameters the $D_{4h}$ states become basically unchanged. These solutions are
chain clusters with well visible $\alpha$ particles.

Figure 1: Baryon density isosurfaces for Skyrmions with baryon number $B=12$ corresponding to the $D_{3h}$-symmetric ground state (left) and the $D_{4h}$-symmetric Hoyle state (right). |  | $\quad E$ |  | $E/B$ |  | $b$ |  | $V_{11}$ |  | $V_{33}$
---|---|---|---|---|---|---|---|---|---|---
Ground state |  | 17.3418 |  | 1.4452 |  | 0.99993 |  | 12540.6 |  | 18363
Hoyle state |  | 17.3553 |  | 1.4464 |  | 0.99994 |  | 26399.3 |  | 5462.2
Table 1: Numerical results for the $D_{3h}$ and $D_{4h}$ symmetric Skyrmions
describing the ground and Hoyle states, respectively. The energy, $E$, and
energy per baryon number, $E/B$, are given in Skyrme units normalised by the
Skyrme-Fadeev bound, while $b=B/12$ is the corresponding baryon number unit.
Similarly, Skyrme units have been used for the spin moment of inertia tensor
eigenvalues.

In the region of parameters that lead to the desired landscape of classical
solutions we increased our accuracy, with a lattice of $148^{3}$ points,
$\Delta x=0.1$ and $\Delta t=0.05$. In fact, for $m_{2}=0.5$ we found the
optimal situation where the mass splitting between the ground and Hoyle states
from the generalized Skyrme model is about $0.08\%$. Hence for this
generalized Skyrme model we not only get the correct ordering of the ground
and Hoyle states but its splitting is comparable to the experimental value of
$0.07\%$. The optimal solution is plotted in Fig. 1. In the figure the baryon
density isosurfaces are shown with a colouring convention based on the
parametrisation of the Skyrme field in terms of a triplet of pionic fields
$\boldsymbol{\pi}=(\pi_{1},\pi_{2},\pi_{3})$ and an auxiliary $\sigma$ field,
$U=\sigma+i\boldsymbol{\pi}\cdot\boldsymbol{\tau}$, such that
$\sigma^{2}+\boldsymbol{\pi}^{2}=1$, with $\boldsymbol{\tau}$ the triplet of
Pauli matrices. Then, regions with a dominant positive (negative) $\pi_{1}$,
$\pi_{2}$ or $\pi_{3}$ fields are coloured in magenta (green), yellow (cyan)
or red (blue), respectively. The classical energy, $E$, energy per baryon
number, $E/B$, and baryon number unit $b=B/12$, i.e., the numerically-obtained
baryon number divided by 12, are shown in Table 1.

##  III Spin quantization and Coulomb energy

In order to have a complete description of the carbon-12 states, two
additional contributions to the energy should be taken into account: the spin
excitations, giving rise to rotational bands, and the Coulomb energy. To
implement the former, one has to quantize the Skyrmions. This is usually done
through a semi-classical quantization of the rotational and iso-rotational
degrees of freedom which give rise to the spin and isospin quantum numbers ANW
; Manko2007 . In this procedure one introduces $B$ rotational and $A$
isorotational transfomations of the classical Skyrmion $U(\boldsymbol{x})\to
AU(R_{B}\boldsymbol{x})A^{\dagger}$ and promotes them to time-dependent
collective coordinates. Here $A,B\in SU(2)$ and
$R_{B}=\frac{1}{2}\mbox{Tr}(\tau_{i}B\tau_{J}B^{\dagger})$, where $\tau_{i}$
are Pauli matrices. Then we arrive at a (mechanical) Hamiltonian which is
quantized in the canonical way. In fact, the resulting Hamiltonian is similar
to a rigid rotor one and is given in terms of the corresponding moment of
inertia tensors of spin and isospin together with the spin and isospin
operators, for a review see NM-book .

Since the carbon-12 has zero isospin, we only need to consider the spin moment
of inertia tensor, $V_{ij}$, which for the generalized Skyrme model reads
(remember, $c_{4}=c_{6}=1$ for the optimal choice)

$V_{ij}=-\epsilon_{ikl}\epsilon_{jmn}\int x_{k}x_{m}\left[{\rm
Tr}\left(R_{l}R_{n}+\frac{c_{4}}{4}[R_{p},R_{l}][R_{p},R_{n}]\right)-c_{6}{\rm
Tr}(\epsilon_{pqr}R_{l}R_{q}R_{r}){\rm
Tr}(\epsilon_{pst}R_{n}R_{s}R_{t})\right]d^{3}x.$ (6)

Due to the symmetry of the configurations, the tensor $V_{ij}$ is that of a
symmetric top, that is to say, diagonal with two equal eigenvalues,
$V_{11}=V_{22}$, different from the third, $V_{33}$. Hence, the corresponding
quantum contribution takes the form

$E_{\rm
rot}=\frac{1}{2V_{11}}J(J+1)+\left(\frac{1}{2V_{33}}-\frac{1}{2V_{11}}\right)k^{2},$
(7)

where $J$ corresponds to the spin quantum number and $k$ is the third
component of the spin in the body-fixed frame. The obtained eigenvalues of the
spin moment of inertia tensor for our solutions of interest are also displayed
in Table 1.

It is very well known that the discrete symmetries of the solitons impose some
constraints restricting the allowed quantum states. These are the Finkelstein-
Rubistein constraints Finkelstein1968  and have been already discussed in the
literature for both configurations Battye2009 ; Lau2014 . In particular, the
ground state symmetry $D_{3h}$ allows for states with $k$ being zero or a
multiple of 3, while for the Hoyle solution, states with $k=0$ and 4 are
predicted. Since these results are entirely due to the symmetry of the
classical Skyrmions, they remain unchanged in the case of our solutions
obtained in the generalized Skyrme model. As pointed out in Lau2014 , this
offers a successful description of the rotational bands of both states of
carbon-12 within the Skyrme model, leading also to the prediction of new
states. For instance, it naturally supports the $0^{+}$, $2^{+}$ and $4^{+}$
states of the ground state band with excitation energies 0, 4.4 and 14.1 MeV,
together with those of the Hoyle band having excitation energies 7.65, 9.8 and
13.3 MeV (for the states we have used the common notation $J^{P}$, where $J$
and $P$ correspond to the total spin and parity, respectively).

Finally we consider the Coulomb energy, which can be expressed in terms of the
electric charge density of the soliton by its generalization for volume charge
densities,

$E_{\rm C}=\frac{1}{2\varepsilon_{0}}\int\int
d^{3}rd^{3}r^{\prime}\frac{\rho(\boldsymbol{r})\rho(\boldsymbol{r^{\prime}})}{4\pi|\boldsymbol{r}-\boldsymbol{r^{\prime}}|},$
(8)

where $\varepsilon_{0}=\frac{1}{\rm e}\,8.8542\cdot 10^{-21}\,{\rm
MeV}^{-1}\,{\rm fm}^{-1}$ is the permittivity of free space with ${\rm
e}=1.60218\cdot 10^{-19}$ C. Since for carbon-12 the isospin vanishes, its
electric charge density is just half the baryon charge density as given in Eq.
(2).

This contribution to the energy has been previously computed both within the
massive Skyrme model Ma2019  and its BPS counterpart Adam2013a ; Adam2013b .
Here we will follow the same strategy which is based on the multipole
expansion of the Coulomb potential Carlson1963

$\frac{1}{4\pi|\boldsymbol{r}-\boldsymbol{r^{\prime}}|}=\sum_{l=0}^{\infty}\sum_{m=-l}^{l}\frac{1}{2l+1}\frac{r_{<}^{l}}{r_{>}^{l+1}}Y^{*}_{lm}(\theta^{\prime},\phi^{\prime})Y_{lm}(\theta,\phi),$
(9)

with $r_{<}={\rm min}(r,r^{\prime})$, $r_{>}={\rm max}(r,r^{\prime})$ and
$Y_{lm}(\theta,\phi)$ the usual spherical harmonics. Then, by considering the
expansion of the charge density in spherical harmonics

$\rho(\boldsymbol{r})=\sum_{l,m}\rho_{lm}(r)Y^{*}_{lm}(\theta,\phi),$ (10)

and defining the quantities

$Q_{lm}(r)=\int_{0}^{r}dr^{\prime}r^{\prime
l+2}\rho_{lm}(r^{\prime}),\qquad\qquad
U_{lm}=\frac{1}{2\varepsilon_{0}}\int_{0}^{\infty}drr^{-2l-2}|Q_{lm}(r)|^{2},$
(11)

the Coulomb energy can be reduced to

$E_{\rm C}=\sum_{l=0}^{\infty}\sum_{m=-l}^{l}U_{lm}.$ (12)

This is a convergent series in the multipole index $l$ which we truncate to a
value high enough ($l=30$ in our case) such that the change in the Coulomb
energy is less than $10^{-4}$ MeV.

##  IV Results

To discuss the physical content of our findings we have to go from Skyrme
units to physical units. This is straightforward for the classical energy of
the Skyrmion given by the energy functional Eq. (4). It simply requires
multiplication by the energy scale $f_{\pi}/(4e)$. The next contribution to
consider is the spin quantum correction. In this case, we need to bring the
physical units to the moment of inertia tensor, Eq. (6), multiplying it by the
energy scale and the length scale squared. As a result, the spin excitations
gain a global factor $e^{3}f_{\pi}$. Finally, we can see from Eq. (8) that to
convert the Coulomb energy to physical units we need to introduce a factor
equal to the inverse of the length scale, namely, $ef_{\pi}/2$.

Hence, after conversion to physical units, the total energy of the
semiclassically quantized Skyrmions with Coulomb interaction included will
read

$E_{\rm ph}=\frac{f_{\pi}}{4e}\,E+e^{3}f_{\pi}\,E_{\rm
rot}+\frac{ef_{\pi}}{2}\,E_{\rm C}.$ (13)

Now, we have to calibrate our model, that is to say, find suitable values for
the constants $f_{\pi}$ and $e$. For this purpose, we will fit the ground
state energy, $E_{\rm GS}=11177.9\;{\rm MeV}$, and the ground state rotational
band slope to the physical values (with excitation energies 0, 4.4 and 14.1
MeV, respectively). This is equivalent to impose $e^{3}f_{\pi}=17740.0$ MeV
and to set the energy per baryon number of our corresponding Skyrmion to one
atomic mass unit – amu, ($1\;{\rm amu}=931.494\;{\rm MeV}$). Hence, our
calibration reads

$e=5.34383,\qquad\qquad f_{\pi}=116.256\;{\rm MeV}.$ (14)

This also implies a value of the pion mass $m_{\pi}=163\;{\rm MeV}$, which is
basically equal to the best value obtained in Lau2014  (162 MeV) and which is
quite close to the experimental value of 138 MeV.

|  | $\quad E$ |  | $E_{\rm rot}\;(2^{+})$ |  | $E_{\rm rot}\;(4^{+})$ |  | $E_{\rm C}$
---|---|---|---|---|---|---|---|---
Ground state |  | 11171.34 |  | 4.24 |  | 14.15 |  | 6.56
Hoyle state |  | 11180.04 |  | 2.02 |  | 6.72 |  | 6.02
Table 2: Soliton classical energy, $E$, rotational, $E_{\rm rot}$, and Coulomb
energy, $E_{\rm C}$, contributions to the ground and Hoyle states of the
carbon-12 in physical units (MeV) after calibration, Eq. (14). In the case of
the rotational energy we omit the $0^{+}$ states with vanishing contribution.

Taking these values we find the different contributions to the energy of the
ground and Hoyle states in physical units as shown in Table 2. In particular,
the energy of Hoyle state is

$E_{\rm Hoyle}=11186.1\;{\rm MeV},$ (15)

which leads to a mass splitting at the level about $0.07\%$, matching the
value found in nature. In this way, the inclusion of additional terms to the
Skyrme Lagrangian seems to be unavoidable in order to correct this issue of a
wrong ordering in energy of the two configurations that is found in the Skyrme
model, both in its standard version and in some extensions such as the
coupling to rho mesons Naya2018 .

Figure 2: Rotational bands for the ground (blue line) and Hoyle (red line)
states obtained from the generalised Skyrme model. They show the excitation
energy with respect to the ground state. Blue circles and red squares indicate
the experimentally determined states $0^{+}$, $2^{+}$ and $4^{+}$ of the
ground and Hoyle states, respectively.

Importantly, the inclusion of the new terms in the Lagrangian does not spoil
the slope of the Hoyle band. It is still close to the physical value, see in
Fig. 2. Indeed, the ratio between the slopes of the ground and the Hoyle bands
is 2.11 in our model, so it is a little bit below the experimentally estimated
value of 2.45. In the massive Skyrme model this ratio was slightly above the
experimental value, 2.52.

Finally, we can also study the root mean square matter radius, $\langle
r^{2}\rangle^{1/2}$, defined as

$\langle
r^{2}\rangle^{1/2}=\left(\frac{\int\mathcal{E}(\boldsymbol{x})r^{2}d^{3}x}{\int\mathcal{E}(\boldsymbol{x})d^{3}x}\right)^{1/2},$
(16)

with $\mathcal{E}(\boldsymbol{x})$ the static energy density given by the
integrand of Eq. (4). We find the values 2.14 fm and 2.44 fm for the ground
and Hoyle states, respectively. These results are slightly under the
experimental value of 2.43 fm for the ground state Tanihata1985  and an
inferred 2.89 fm for the Hoyle state Danilov2009 . We should note that our
values here depend on the calibration of the model; however, their ratio does
not. We obtain then a ratio of 1.14 to be compared with 1.19, resulting in a
good agreement.

##  V Summary

In this work, we have shown that the inclusion of two additional terms to the
massive Skyrme model, the sextic term and the pion mass potential squared,
fixes one main issue of the description of 12C nuclei in terms of Skyrmions,
namely the correct energy ordering of the $D_{3h}$ symmetric triangle and the
$D_{4h}$ chain, already for the classical soliton solutions. These solutions
were interpreted as corresponding to the ground and the Hoyle states
respectively. However, in the massive Skyrme model the triangle solution has
slightly higher energy than the chain solution which, obviously, does not
correspond to the correct physical order. The inclusion of the two further
terms leads to the right ordering. Importantly, this extension of the Skyrme
theory does not spoil the $\alpha$-particle clustering in the Skyrmions and
has only a small impact on the spin moment of inertia. Therefore, we still get
essentially the correct slopes of the excitation spectra built on top of both
zero spin states, besides a remarkable agreement for their root mean square
matter radius ratio.

In a wider perspective, the present work belongs to the class of
investigations which try to determine the most important extensions and
generalizations of the Skyrme model which are necessary for a quantitatively
precise description of physical nuclei and nuclear matter. The original Skyrme
model is a fascinating proposal which incorporates many nontrivial properties
of low-energy QCD in a natural way, but its quantitative precision is
typically at the 30% level, and some results, like the shapes or excitation
spectra of some nuclei, are simply not correct. Therefore, possible
generalizations sextic ; marleau  were considered already soon after the
interest in the Skyrme model resumed ANW , but the systematic study of
generalizations of the Skyrme model only started about one decade ago, partly
motivated by the more powerful numerical resources which are available
nowadays. In this context, we just want to point out that the two new terms we
included are very natural in the solitonic Skyrme model framework. The sextic
term is unavoidable in the high density regime, where it provides the most
important contribution, leading to a sufficiently stiff equation of state
which, e.g., supports neutron stars with sufficiently high masses, in
agreement with observational data Naya-NS ; SK-NS-1 ; SK-NS-2 ; SK-NS-3 .
Furthermore, both this term and the additional potential, which together form
the BPS Skyrme model, provide a way to reduce the binding energies of
Skyrmions, which are excessively large when compared with physical nuclei.

## Acknowledgements

The authors thank David Foster for his work at the initial stage of the
project. CN thanks Miguel Huidobro for discussions and also running some
Skyrmions at the initial stage of the parameter space exploration, serving as
a double check. CA acknowledges financial support from the Ministry of
Education, Culture, and Sports, Spain (Grant No. PID2020-119632GB-I00), the
Xunta de Galicia (Grant No. INCITE09.296.035PR and Centro singular de
investigacion de Galicia accreditation 2019- 2022), the Spanish Consolider-
Ingenio 2010 Programme CPAN (CSD2007-00042), and the European Union ERDF. CN
and AW were supported by the Polish National Science Centre (NCN
2020/39/B/ST2/01553). This research utilized the Sunrise HPC facility
supported by the Technical Division at the Department of Physics, Stockholm
University.

## References

  * (1) T. H. R. Skyrme, A non-linear field theory, Proc. R. Soc. Lond. A 260 (1961) 127.
  * (2) G. Holzwarth and B. Schwesinger, Baryons in the Skyrme Model. Rept. Prog. Phys. 49 (1986) 825.
  * (3) N. S. Manton, Skyrmions - A Theory of Nuclei, World Scientific Publishing Europe Ltd., London, 2022.
  * (4) M. Rho and I. Zahed, (Eds.) Multifaceted Skyrmion, 2nd ed.; World Scientific: Singapore, 2017.
  * (5) G.S. Adkins, C.R. Nappi and E. Witten, Static properties of nucleons in the Skyrme model, Nucl.Phys. B 228 (1983) 552.
  * (6) C. J. Halcrow, Vibrational quantisation of the B = 7 Skyrmion, Nucl. Phys. B 904 (2016) 106.
  * (7) O. V. Manko, N. S. Manton, and S. W. Wood, Light nuclei as quantized skyrmions, Phys. Rev. C 76 (2007) 055203.
  * (8) R. A. Battye, N. S. Manton, P. M. Sutcliffe and S. W. Wood, Light nuclei of even mass number in the Skyrme model, Phys. Rev. C 80 (2009) 034323.
  * (9) C. J. Halcrow, C. King and N. S. Manton, Dynamical $\alpha$-cluster model of 16O, Phys. Rev. C 95 (2017) 031303.
  * (10) C. Halcrow, C. King and N. S. Manton, Oxygen-16 spectrum from tetrahedral vibrations and their rotational excitation, Int. J. Mod. Phys. E 28 (2019) 1950026.
  * (11) F. Hoyle, On Nuclear Reactions Occuring in Very Hot Stars. 1. The Synthesis of Elements from Carbon to Nickel, Astrophys. J. Suppl. 1 (1954) 121.
  * (12) P. H. C. Lau and N. S. Manton, States of Carbon-12 in the Skyrme Model, Phys. Rev. Lett. 113 (2014) 232503.
  * (13) R. A. Battye, N. S. Manton and P. M. Sutcliffe, Skyrmions and the alpha-particle model of nuclei, Proc. R. Soc. A 463 (2007) 261.
  * (14) J. I. Rawlinson, An alpha particle model for Carbon-12, Nucl. Phys. A 975 (2018) 122.
  * (15) C. Adam, J. Sanchez-Guillen and A. Wereszczynski, A Skyrme-type proposal for baryonic matter. Phys. Lett. B 691 (2010) 105.
  * (16) A. Jackson, A.D. Jackson, A.S. Goldhaber, G.E. Brown and L.C. Castillejo, A modified skyrmion, Phys. Lett. B 154 (1985) 101.
  * (17) S. B. Gudnason, Loosening up the Skyrme model, Phys. Rev. D 93 (2016) 065048.
  * (18) S.B. Gudnason, B. Zhang and N. Ma, Generalized Skyrme model with the loosely bound potential, Phys. Rev. D 94 (2016) 125004.
  * (19) S. B. Gudnason and M. Nitta, Modifying the pion mass in the loosely bound Skyrme model, Phys. Rev. D 94 (2016) 065018.
  * (20) D. Harland, Topological energy bounds for the Skyrme and Faddeev models with massive pions, Phys. Lett. B 728 (2014) 518.
  * (21) M. Gillard, D. Harland and M. Speight, Skyrmions with low binding energies, Nucl. Phys. B 895 (2015) 272.
  * (22) C. Adam, M. Haberichter and A. Wereszczynski, Skyrme models and nuclear matter equation of state, Phys. Rev. C 92 (2015) 055807.
  * (23) L. D. Faddeev, Some comments on the many dimensional solitons, Lett. Math. Phys. 1 (1976) 289.
  * (24) C. Naya and P. M. Sutcliffe, Skyrmions and Clustering in Light Nuclei, Phys. Rev. Lett. 121 (2018) 232002.
  * (25) R. A. Battye and P. M. Sutcliffe, Skyrmions with massive pions, Phys. Rev. C 73 (2006) 055205.
  * (26) D. Finkelstein and J. Rubinstein, Connection between Spin, Statistics, and Kinks, J. Math. Phys. 9 (1968) 1762.
  * (27) N. Ma, C. J. Halcrow, and H. Zhang, Effect of the Coulomb energy on Skyrmions, Phys. Rev. C 99 (2019) 044312.
  * (28) C. Adam, C. Naya, C. Sanchez-Guillen, and A. Wereszczynski, Bogomol’nyi-Prasad-Sommerfield Skyrme Model and Nuclear Binding Energies, Phys. Rev. Lett. 111 (2013) 232501.
  * (29) C. Adam, C. Naya, C. Sanchez-Guillen, and A. Wereszczynski, Nuclear binding energies from a Bogomol’nyi-Prasad-Sommerfield Skyrme model, Phys. Rev. C 88 (2013) 054313.
  * (30) B. C. Carlson and G. L. Morley, Multipole expansion of Coulomb energy, Am. J. Phys. 31 (1963) 209.
  * (31) I. Tanihata, H. Hamagaki, O. Hashimoto, Y. Shida, N. Yoshikawa, K. Sugimoto, O. Yamakawa, T. Kobayashi, and N. Takahashi, Measurements of Interaction Cross Sections and Nuclear Radii in the Light p-Shell Region, Phys. Rev. Lett. 55 (1985) 2676.
  * (32) A. N. Danilov, T. L. Belyaeva, A. S. Demyanova, S. A. Goncharov, and A. A. Ogloblin, Determination of nuclear radii for unstable states in 12C with diffraction inelastic scattering, Phys. Rev. C 80 (2009) 054603.
  * (33) L. Marleau, Modifying the Skyrme model: Pion mass and higher derivatives, Phys. Rev. D 43 (1991) 885.
  * (34) C. Naya, Neutron Stars within the Skyrme Model, Int. J. Mod. Phys. E 28 (2019) 1930006.
  * (35) C. Adam, A. Garcia Martín-Caro, M. Huidobro, R. Vázquez and A. Wereszczynski, A new consistent neutron star equation of state from a generalized Skyrme model, Phys. Lett. B 811 (2020) 135928.
  * (36) C. Adam, A. Garcia Martín-Caro, M. Huidobro and A. Wereszczynski, Kaon condensation in skyrmion matter and compact stars, Phys. Rev. D 107 (2023) 074007.
  * (37) P. Leask, M. Huidobro and A. Wereszczynski, Neutron stars from skyrmion branes, arXiv:2306.04533.