|
|||||||||||
|
Re: MySQL Cluster performance question
From: Al <broohaha(at)gmail.com>
Date: Mon Aug 20 2007 - 16:53:01 EDT
mysql> select distinct gv_symbol from past30_ndb force
index(`gvsymtime`) where 1;
mysql> select distinct gv_symbol from past30_MYISAM force index(`gvsymtime`)
where 1;
It seems better without the force index:
mysql> select distinct gv_symbol from past30_ndb where 1;
...
mysql> select distinct gv_symbol from past30_MYISAM where 1;
...
And here are some EXPLAINs: mysql> explain select distinct gv_symbol from past30_ndb where 1; ----+-------------+------------+------+---------------+------+---------+------+----------+-----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+------+---------------+------+---------+------+----------+-----------------+ | 1 | SIMPLE | past30_ndb | ALL | NULL | NULL | NULL |NULL | 10000000 | Using temporary | +----+-------------+------------+------+---------------+------+---------+------+----------+-----------------+1 row in set (0.00 sec)
mysql> explain select distinct gv_symbol from past30_ndb force index
(`gvsymtime`) where 1;
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+-------+---------------+-----------+---------+------+----------+-------+ | 1 | SIMPLE | past30_ndb | index | NULL | gvsymtime | 56 | NULL | 10000000 | | +----+-------------+------------+-------+---------------+-----------+---------+------+----------+-------+ 1 row in set (0.00 sec) mysql> explain select sql_buffer_result distinct gv_symbol from past30_ndb force index (`gvsymtime`) where 1; +----+-------------+------------+-------+---------------+-----------+---------+------+----------+-----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+-------+---------------+-----------+---------+------+----------+-----------------+ | 1 | SIMPLE | past30_ndb | index | NULL | gvsymtime | 56 | NULL | 10000000 | Using temporary | +----+-------------+------------+-------+---------------+-----------+---------+------+----------+-----------------+1 row in set (0.00 sec) The create tables on both tables are:
CREATE TABLE `past30_ndb` (
CREATE TABLE `past30_MYISAM` (
On 8/16/07, Stewart Smith <stewart@mysql.com> wrote: > On Thu, 2007-08-09 at 13:31 -0500, Brian Moon wrote: > > > mysql> SELECT DISTINCT gv_symbol FROM `past30_ndb_disk` FORCE INDEX > > > (`gvsymtime`) WHERE 1; > > > 90 rows in set (4 min 44.90 sec) > > > > > > mysql> SELECT DISTINCT gv_symbol FROM `past30_MYISAM` FORCE INDEX > > > (`gvsymtime`) WHERE 1; > > > 90 rows in set (1.54 sec) > > > > Can we see the create table on these? Frankly, the 1.54 seconds on the > > myisam seems low to me if a good key is used. > > and EXPLAIN > -- > Stewart Smith, Senior Software Engineer > MySQL AB, www.mysql.com > Office: +14082136540 Ext: 6616 > VoIP: 6616@sip.us.mysql.com > Mobile: +61 4 3 8844 332 > > Jumpstart your cluster: > http://www.mysql.com/consulting/packaged/cluster.html > >Received on Mon Aug 20 16:53:22 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:15:02 EDT |
||||||||||
|
|||||||||||