[MCOL-2105] Improve disk join behavior for unfortunate data distributions Created: 2019-01-24  Updated: 2023-07-02  Resolved: 2023-07-02

Status: Closed
Project: MariaDB ColumnStore
Component/s: N/A
Affects Version/s: 1.0.15, 1.1.6, 1.2.2
Fix Version/s: Icebox

Type: Task Priority: Major
Reporter: Patrick LeBlanc (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
PartOf
is part of MCOL-4343 umbrella for tech debt issues Open

 Description   

We've recently run into a couple cases where the disk join was triggered, but the data distribution was such that there were so many rows with a single value in the join column that it overflowed a partition in the loading stage. We currently reject the query when that happens, but it should be easy to handle as a special case.

For reference, the disk join algorithm is called 'GRACE', you can google 'grace join algorithm' to get more understanding of what it's doing.

In the code, to find the place where it detects the data distribution problem, grep for 'ERR_DBJ_DATA_DISTRIBUTION' in joinpartition.cpp.

My initial thoughts.
1) We can let partitions with a very small range of join values grow unbounded up to the total disk usage limit.
2) Set a flag on such partitions to indicate they shouldn't be loaded into a hash table when the join phase start.
3) Instead, it should be possible to stream those rows from disk when a row in the 'other' table matches, doing effectively a nested loop join instead of a hash join for those partitions.

It'll take some understanding of the partitioning structures & behavior; whoever gets this one, feel free to ask me.



 Comments   
Comment by Patrick LeBlanc (Inactive) [ 2019-01-24 ]

Added the support case

Comment by Patrick LeBlanc (Inactive) [ 2019-02-15 ]

The workaround suggested in MCOL-2108 seems to have pacified the most recent customer with the problem.

Comment by Todd Stoffel (Inactive) [ 2023-07-02 ]

The "create date" on this ticket is pre-convergence with MariaDB server. If the issue still exists in a modern version of the engine/plugin please submit a new ticket.

Generated at Thu Feb 08 02:33:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.