pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.86k stars 5.8k forks source link

Multi-Way Join Operators #4785

Open hanfei1991 opened 6 years ago

hanfei1991 commented 6 years ago
  1. For Multi-Way Hash Join: Build a single hash table, probed by multiple other tables. The performance can be obtained to avoid building hash table multiple times.

  2. For Multi-Way Merge Join: compare join keys belonging to different tables at the same time. All the join keys are only compared once. Saved many compare operations performed on the current two-way Merge Join

  3. For Multi-Wat Index Join: We can read from a single table, transform join key into index keys for different tables to read multiple tables according to the index at the same time. Which can saves a lot of index key construction operations on the current two-way Index Join.

SunRunAway commented 4 years ago

This paper introduces a way to reorder join tables during execution by using the information of bloom filter. It builds multiple hash tables(and bloom filters) for each table concurrently, then probed by one biggest table.

Looking Ahead Makes Query Plans Robust

winoros commented 4 years ago

Should this one also be in executor component too? @SunRunAway

ichn-hu commented 4 years ago

I suppose to close this issue, planner and executor should both be involved.

ichn-hu commented 4 years ago

@SunRunAway Thanks for the paper, I'll read it.

zz-jason commented 4 years ago

I suppose to close this issue, planner and executor should both be involved.

You can use this issue to trace all the progress. For example: proposal -> develop tasks -> tests -> user documents