[Postgres-xl-developers] join restriction
senhu at tencent.com
Wed Jun 21 00:36:44 PDT 2017
When I run some join queries on PG-XL 9.6, I find that if the data types of two join args are different, the
data redistribution is forbidded, and I find this restriction on source code. In function ‘set_joinpath_distribution’,
there is piece of code:
* Check if both parts are of the same data type and choose
* distribution type to redistribute.
* XXX We may want more sophisticated algorithm to choose
* the best condition to redistribute parts along.
* For now use simple but reliable approach.
if (leftType != rightType)
If we can remove this restriction to make join more efficient with different join data types, such as int join bigint.
On the other hand, we can add some other conditions to make the decision. For example, we can use the row counts of both
Left and right rels of join.
If both rels have small row counts, data redistributed is not needed, gather the tuples of two rels, and join on one node.
Otherwise, we try to redistribute the smaller rel as possible.
Senhu(senhu at tencent.com<mailto:senhu at tencent.com>)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Postgres-xl-developers