Spider Cluster Management
You are viewing an old version of this article. View
the current version here.
Contents
Direct SQL
Direct SQL is a way to map reduce execution on remote backend and store the result in a local table.
In sequential using the UDF function spider_direct_sql
or concurrently using spider_bg_direct_sql
.
MariaDB starting with 10.0.4
The Spider storage engine was introduced in MariaDB 10.0.4, Direct SQL is reported to not work in the first releases, it is expected to be fixed in MariaDB 10.0.7 or MariaDB 10.0.8, ask a SkySQL representative for available patch.
spider1 backend << EOF CREATE TEMPORARY TABLE res ( id int(10) unsigned NOT NULL, k int(10) unsigned NOT NULL DEFAULT '0', c char(120) NOT NULL DEFAULT '', pad char(60) NOT NULL DEFAULT '' ) ENGINE=MEMORY; SELECT spider_direct_sql( 'SELECT * FROM sbtest s WHERE s.id IN(10,12,13)', 'res', concat('host "', host, '", port "', port, '", user "', username, '", password "', password, '", database "', tgt_db_name, '"') ) a FROM mysql.spider_tables WHERE db_name = 'backend' and table_name like 'sbtest#P#pt%'; SELECT * FROM res; EOF
Resharding
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.