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

建议加个高效分页, 我找了一个开源的, 你看看是否可行 #314

Open
ghost opened this issue Feb 23, 2024 · 3 comments
Open

Comments

@ghost
Copy link

ghost commented Feb 23, 2024

https://github.com/icza/minquery/tree/v2.0.0

这个看说明, 是说可以通过索引更加高效分页, 感觉我们也可以加上这功能.

@cupen
Copy link

cupen commented Mar 23, 2024

高不高效取决于索引。分页本身就一个 skip & count & sort 的事,不用在 driver 层做,让业务层代码自行处理。

@ghost
Copy link
Author

ghost commented Mar 23, 2024

高效率不取决于索引。分页本身就是一个skip & count & sort的事情,不用在驱动层做,让业务层代码自行处理。

https://mongoing.com/archives/74118
这是中文官网的文档, 说是分页越大, 越往后就越慢. 有点像是mysql.

@cupen
Copy link

cupen commented Mar 26, 2024

高效率不取决于索引。分页本身就是一个skip & count & sort的事情,不用在驱动层做,让业务层代码自行处理。

https://mongoing.com/archives/74118 这是中文官网的文档, 说是分页越大, 越往后就越慢. 有点像是mysql.

这说的就是索引问题,遵循 ESR 原则就凑合了。凑合不了就用那些 hack 方案,没法标准化。总之无论如何都不该由 driver 摆平的。

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

1 participant