MySQL Forums
Forum List  »  Falcon

Re: Falcon can not use index for sorting?
Posted by: Yuan WANG
Date: May 28, 2007 03:16PM

Yeah, you are right. As I have specified "a = 1" and a is the primary key, so there will be at most one row. In this situation, the sort should be totally unnecessary.

However, if we have more than one row, I found that Falcon still can not use index for sorting. Here is an example:

mysql> create table t(a int primary key, b int, c int) engine = falcon;
mysql> create index idx_t_ba on t(b, a);
mysql> insert into t values(1, 1, 1);
mysql> insert into t values(2, 1, 1);
mysql> explain select * from t where b = 1 order by a desc;
+----+-------------+-------+------+---------------+----------+---------+-------+------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+----------+---------+-------+------+-----------------------------+
| 1 | SIMPLE | t | ref | idx_t_ba | idx_t_ba | 5 | const | 10 | Using where; Using filesort |
+----+-------------+-------+------+---------------+----------+---------+-------+------+-----------------------------+
mysql> alter table t engine = innodb;
mysql> explain select * from t where b = 1 order by a desc;
+----+-------------+-------+------+---------------+----------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+----------+---------+-------+------+-------------+
| 1 | SIMPLE | t | ref | idx_t_ba | idx_t_ba | 5 | const | 1 | Using where |
+----+-------------+-------+------+---------------+----------+---------+-------+------+-------------+

So you can see, InnoDB can use index for sorting but Falcon can't. In practice this should be a major problem, I think.

Options: ReplyQuote


Subject
Written By
Posted
Re: Falcon can not use index for sorting?
May 28, 2007 03:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.