Skip to content

Feature: functional dependency optimization #7438

Open
@leiysky

Description

@leiysky

A functional dependency is a relationship between two attributes in the same database.

If an attribute determines another attribute, we will call it a determinant, and the determined attribute is functionally dependent on the determinant.

We will denote the relationship with $X \rightarrow Y$ if $X$ is a determinant of $Y$, where both $X$ and $Y$ can be a set of attributes.

For example, given a SQL:

select a, a+1 as b from t;

Here the attribute a is a determinant of b because b is derived from a. Thus we can get a functional dependency $(a) \rightarrow (b)$.

Functional dependency is helpful in query optimization, with it we can eliminate outer joins, eliminate useless DISTINCT, eliminate cross joins and etc.

Reference wiki and the thesis for more details.

The functional dependencies can be derived from relational operators, so it's possible to encapsulate them into RelationalProperty.

Metadata

Metadata

Assignees

Labels

A-plannerArea: planner/optimizerC-featureCategory: feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions