Skip to content

[SQL] Share indexes between joins #5815

@mihaibudiu

Description

@mihaibudiu

Two indexes can be shared when they have the same keys and the same values and they are produced by indexing the same input data source. CSE should actually detect this pattern.

However, the case when the keys are the same, but the values are different is more interesting. In this case the two indexes can be unified by choosing a value which is a superset of both values.

So the optimization will need to:

  • find map_index operators with a common source
  • producing the same key
  • and different values
  • feeding into a subsequent join each

The optimization will rewrite the map_index operators to produce the same value, a superset of the fields of both, and it will rewrite the subsequent joins to use the correct fields of the values.

Metadata

Metadata

Assignees

Labels

SQL compilerRelated to the SQL compilerhigh priorityTask should be tackled first, added in the current sprint if necessary

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions