请教一个问题,在一张mrg表中,我没加索引时可以查到数据,加了索引后就查不到,请问是什么原因呢?mysql> select count(*) from SaleCaseProc where procTime>='2009-04-01';
+----------+
| count(*) |
+----------+
| 77924 |
+----------+
1 row in set (8.58 sec)mysql> create index IX_CaseProc_ProcTime on SaleCaseProc(procTime);
Query OK, 0 rows affected (0.87 sec)
Records: 0 Duplicates: 0 Warnings: 0mysql> select count(*) from SaleCaseProc where procTime>='2009-04-01';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.16 sec)一样的查询语句,加了索引就没数据了
+----------+
| count(*) |
+----------+
| 77924 |
+----------+
1 row in set (8.58 sec)mysql> create index IX_CaseProc_ProcTime on SaleCaseProc(procTime);
Query OK, 0 rows affected (0.87 sec)
Records: 0 Duplicates: 0 Warnings: 0mysql> select count(*) from SaleCaseProc where procTime>='2009-04-01';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.16 sec)一样的查询语句,加了索引就没数据了
-> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> message CHAR(20)) ENGINE=MyISAM;
mysql> CREATE TABLE t2 (
-> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> message CHAR(20)) ENGINE=MyISAM;
mysql> INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1');
mysql> INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2');
mysql> CREATE TABLE total (
-> a INT NOT NULL AUTO_INCREMENT,
-> message CHAR(20), INDEX(a))
-> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;这里好像是merge表"total"中message列中有加索引INDEX(a)?难道是因为定义好了就不能再修改索引了吗?