Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

should cnpmjs support ignore case search? #450

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

should cnpmjs support ignore case search? #450

alsotang opened this issue Sep 23, 2014 · 13 comments

Comments

@alsotang
Copy link
Member

image

@dead-horse
Copy link
Member

@dead-horse
Copy link
Member

but search need support

@dead-horse
Copy link
Member

1.5.1 ping @fengmk2

@fengmk2
Copy link
Member

fengmk2 commented Sep 23, 2014

How about performance?

@fengmk2
Copy link
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于 [email protected]写道:

How about performance?

@dead-horse
Copy link
Member

not sure, try in cnpm's mysql first?

@fengmk2
Copy link
Member

fengmk2 commented Sep 23, 2014

use explain to check

@alsotang
Copy link
Member Author

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 [email protected] 写道:

use explain to check

Reply to this email directly or view it on GitHub.

@dead-horse
Copy link
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
Copy link
Member Author

image

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

@dead-horse
Copy link
Member

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

@alsotang
Copy link
Member Author

嗯嗯,也好。
在 2014年9月23日,22:08,dead_horse [email protected] 写道:

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


Reply to this email directly or view it on GitHub.

@fengmk2
Copy link
Member

fengmk2 commented Sep 23, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants