I'm pleased to announce the release of Spider storage engine version 2.1(beta).
http://spiderformysql.com/
The main changes in this version are following.
- Add UDFs "spider_direct_sql" and "spider_bg_direct_sql".
These UDFs execute hand writing SQLs on remote server by using Spider's table link and store result sets in temporary tables.
Main usages are following.
1.Maintenance remote servers.
(Create table on remote servers for Spider's link tables, etc.)
2.Use every resources (excluding table) on remote servers.
3.Mass update of the bulk data. (Update all rows in tables, etc.
There are next advantages. It is possible to update it in parallel
with multiple remote servers. The amount of the data transfer of
a local server and remote servers can be reduced)
4.Aggregate by 2-steps. (For DWH etc)
First step: Aggregate on remote servers and collect result
to local server.
Second step: Aggregate on local server.
(There are next advantages. It is possible to aggregate it in
parallel with multiple remote servers. The amount of the data
transfer of a local server and remote servers can be reduced)
Example of 2-steps aggregating
(Count the number of rows in 7 shards tables from local server)
-------------------------------------------------------------------------------
Prepare for aggregating:
mysql> create table target_hosts (host char(17))engine=myisam;
Query OK, 0 rows affected (0.01 sec)
mysql> insert into target_hosts (host) values ('192.168.22.13'),('192.168.22.14'),('192.168.22.15'),('192.168.22.16'),('192.168.22.51'),('192.168.22.52'),('192.168.22.53');
Query OK, 7 rows affected (0.00 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> create temporary table a (a int)engine=myisam;
Query OK, 0 rows affected (0.00 sec)
Execute aggregating:
mysql> select sum(a.a) from a, (select sum(spider_direct_sql('select count(*) from data01', 'a', concat('srv "s", host "', host, '"'))) cnt from target_hosts) c;
+-----------+
| sum(a.a) |
+-----------+
| 117641811 |
+-----------+
1 row in set (40.86 sec)
mysql> truncate table a;
Query OK, 0 rows affected (0.00 sec)
mysql> select sum(a.a) from a, (select spider_bg_direct_sql('select count(*) from data01', 'a', concat('srv "s", host "', host, '"')) cnt from target_hosts) c;
+-----------+
| sum(a.a) |
+-----------+
| 117641811 |
+-----------+
1 row in set (5.91 sec)
-------------------------------------------------------------------------------
Please see "99_change_logs.txt" in the download documents for checking other changes.
Enjoy!
PlanetMySQL Voting:
Vote UP /
Vote DOWN