[Postgres-xl-developers] join restriction

senhu(胡森) senhu at tencent.com
Wed Jun 21 00:36:44 PDT 2017



Hello, all:
      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)
                                  continue;

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.



regards

Senhu(senhu at tencent.com<mailto:senhu at tencent.com>)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20170621/9098948f/attachment.htm>


More information about the Postgres-xl-developers mailing list