![](https://secure.gravatar.com/avatar/06fb7e7f8217ef0e572a8334567b7559.jpg?s=120&d=mm&r=g)
Hi Sergej,
Thank you for this update. I'm still curious: does CONNECT read the rows several times? If so, is there a way to avoid this until the bug is solved?
Regards,
Federico
--------------------------------------------
El lun, 12/5/14, Sergei Golubchik
Hi Sergei
You can repeat this very easily:
MariaDB [test]> CREATE TABLE t_connect (c INT PRIMARY KEY) ENGINE=CONNECT TABLE_TYPE=CSV; Query OK, 0 rows affected, 1 warning (0.11 sec)
Warning (Code 1105): No file name. Table will use t_connect.csv MariaDB [test]> INSERT INTO t_connect VALUES (1),(2);Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]> EXPLAIN SELECT MAX(c) FROM t_connect;
+------+-------------+-----------+------+---------------+------+---------+------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-----------+------+---------------+------+---------+------+------+-------+
| 1 | SIMPLE | t_connect | ALL | NULL | NULL | NULL | NULL | 4 | |
+------+-------------+-----------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)
But adding more rows, the difference between the rows value and the reality becomes big.
Thanks, I've reported it as https://mariadb.atlassian.net/browse/MDEV-6232 I tried to repeat it earlier, but then it uncovered other bugs in the CONNECT indexes, they're fixed now. Your original query gets "Table was optimized away", so I have to modified it a bit for the bug report. Regards, Sergei