should cnpmjs support ignore case search? #450

Closed
alsotang opened this Issue Sep 23, 2014 · 13 comments

Projects

None yet

3 participants

@alsotang
Member

image

@dead-horse
Member

but search need support

@dead-horse
Member

1.5.1 ping @fengmk2

@fengmk2
Member
fengmk2 commented Sep 23, 2014

How about performance?

@fengmk2
Member
fengmk2 commented Sep 23, 2014

We forget the upper case package, it's not allow for package name now.
2014-9-23 下午6:41于 fengmk2@gmail.com写道:

How about performance?

@dead-horse
Member

not sure, try in cnpm's mysql first?

@fengmk2
Member
fengmk2 commented Sep 23, 2014

use explain to check

@alsotang
Member

I think LOWER(name) in LOWER(name) LIKE LOWER(?) AND tag=“latest” would lead to index disable. It’s a sql anti-pattern.
在 2014年9月23日,19:57,fengmk2 notifications@github.com 写道:

use explain to check

Reply to this email directly or view it on GitHub.

@dead-horse
Member
mysql> explain select module_id from tag where name like "%A%";
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra       |
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
|  1 | SIMPLE      | tag   | ALL  | NULL          | NULL | NULL    | NULL |   32 | Using where |
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)

包含前缀匹配本来就走不到索引了,tag 表不大,应该不会太慢?

@alsotang
Member

image

这个还是利用得到索引的。

@dead-horse
Member

看上去大部分的请求都还是要走第二个的,没太大所谓,而且是 tag 表而已。我在全量库里面执行时间可以忽略。

@alsotang
Member

嗯嗯,也好。
在 2014年9月23日,22:08,dead_horse notifications@github.com 写道:

看上去大部分的请求都还是要走第二个的,没太大所谓,而且是 tag 表而已。我在全量库里面执行时间可以忽略。


Reply to this email directly or view it on GitHub.

@fengmk2
Member
fengmk2 commented Sep 23, 2014

嗯,那就先这样,后续考虑一下全文搜索服务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment