Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

性能改进建议 #4

Closed
imlida opened this issue Mar 24, 2021 · 3 comments
Closed

性能改进建议 #4

imlida opened this issue Mar 24, 2021 · 3 comments

Comments

@imlida
Copy link

imlida commented Mar 24, 2021

打印sql日志发现每次判断权限都需要查询全表,如果表数据很大这样查询效率非常低吧
image

@hsluoyz
Copy link

hsluoyz commented Mar 24, 2021

@imlida 不调用数据库的话还好吧,Casbin可以在内存中查询策略

@imlida
Copy link
Author

imlida commented Mar 24, 2021

那只能把单独建一张表来存储用户角色,这里只做角色授权了,如果授权角色也存在这张表的话有几万个用户那这张表就会有几万条记录,没办法查询了。

@donjan-deng
Copy link
Owner

规则常驻内存,并不是每次判断都会查询数据库,前提是未重启Hyperf、未修改规则

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants