Joins are performed in-memory on the UM node. When a join operation exceeds the memory allocated on the UM for query joins, the query is aborted with an error code IDB-2001. Disk-based joins enable such queries to use disk for intermediate join data in case when the memory needed for join exceeds the memory limit on the UM. Although slower in performance as compared to a fully in-memory join, and bound by the temporary space on disk, it does allow such queries to complete.
Note:Disk-based joins does not include aggregation and DML joins.
The following variables in the HashJoin element in the Columnstore.xml configuration file relate to disk-based joins. Columnstore.xml resides in the etc directory for your installation(/usr/local/mariadb/columnstore/etc).
Note: When using disk-based joins, it is strongly recommended that the TempFilePath reside on its own partition as the partition may fill up as queries are executed.
In addition to the system wide flags, at SQL global and session level, the following system variables exists for managing per user memory limit for joins.
For modification at the global level: In my.cnf file (typically /usr/local/mariadb/columnstore/mysql):
[mysqld] ... infinidb_um_mem_limit = value where value is the value in Mb for in memory limitation per user.
For modification at the session level, before issuing your join query from the SQL client, set the session variable as follows.
set infinidb_um_mem_limit = value
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/columnstore-disk-based-joins/