我正在测试InfiniDB社区版,看它是否适合我们的需求。 我在单个表中导入了大约1000万行(加载数据的速度非常快),我正在尝试对它进行一些查询,但这些是结果(使用NON缓存查询...如果InfiniDB中存在查询缓存) :
查询1(非常快):
select * from mytable limit 150000,1000
1000 rows in set (0.04 sec)
查询2(立即):
select count(*) from mytable;
+----------+
| count(*) |
+----------+
| 9429378 |
+----------+
1 row in set (0.00 sec)
好吧,它似乎非常快......但是:
查询3:
select count(title) from mytable;
.. still going after several minutes
查询4:
select id from mytable where id like '%ABCD%';
+------------+
| id |
+------------+
| ABCD |
+------------+
1 row in set (11 min 17.30 sec)
我一定是做错了,不可能用这么简单的查询来执行这种方式。有什么想法吗?
答案 0 :(得分:3)
情况应该不是这样,似乎有些奇怪的事情,请参阅下面的快速测试。
您的服务器配置是什么:内存/操作系统/ CPU和平台(专用,虚拟,云) 我可以获得加载数据的模式声明和方法吗?
您使用的是哪个版本?版本4社区具有比先前版本更多的功能,即核心语法与企业匹配。
干杯, Jim T
mysql> insert into mytable select a, a from (select hex(rand() * 100000) a from lineitem limit 10000000) b;
Query OK, 10000000 rows affected (1 min 54.12 sec)
Records: 10000000 Duplicates: 0 Warnings: 0
mysql> desc mytable;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | varchar(32) | YES | | NULL | |
| title | varchar(32) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)
mysql> select * from mytable limit 150000,1000;
+-------+-------+
| id | title |
+-------+-------+
| E81 | E81 |
| 746A | 746A |
. . .
| DFC8 | DFC8 |
| 2C56 | 2C56 |
+-------+-------+
1000 rows in set (0.07 sec)
mysql> select count(*) from mytable;
+----------+
| count(*) |
+----------+
| 10000000 |
+----------+
1 row in set (0.06 sec)
mysql> select count(title) from mytable;
+--------------+
| count(title) |
+--------------+
| 10000000 |
+--------------+
1 row in set (0.09 sec)
mysql> select id from mytable where id like '%ABCD%' limit 1;
+------+
| id |
+------+
| ABCD |
+------+
1 row in set (0.03 sec)