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

任意楼定位的懒加载 #67

Open
JingYiJun opened this issue Jan 31, 2023 · 2 comments
Open

任意楼定位的懒加载 #67

JingYiJun opened this issue Jan 31, 2023 · 2 comments
Labels
feature request Suggest a new feature low priority

Comments

@JingYiJun
Copy link
Member

Describe the feature

前端如果需要跳转到任意楼层,需要加载整个洞,这对于高回复数的洞是不可取的。

Describe how to implement it

使用 floor.ranking 字段,加载对应楼的上下各 size 个楼,默认 size = 10;返回值中将包含最多 2 * size + 1 个楼。由于一个洞可能很小,一个楼的前后可能都不足 size 个楼,需要前端来判断加载位置。

select hole, ranking from floor where id = ?;
select * from floor where hold_id = ? and ranking between ? - size and ? + size;

What does this feature intend to do

对于高楼层的查询优化

Additional context

@JingYiJun JingYiJun added feature request Suggest a new feature low priority labels Jan 31, 2023
@fsy2001
Copy link
Contributor

fsy2001 commented Feb 5, 2023

该功能是否必要?实测对于1400层的楼可以在1秒内返回,且需要前端修改请求新floor的UI。

@JingYiJun
Copy link
Member Author

有必要的,1秒和10ms还是有质的区别。后端这边会先做出来,前端可以自己考虑是否上线,我建议使用这个新API,在压力非常高的场合,比如高搜索压力的时候可能可以用到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggest a new feature low priority
Projects
None yet
Development

No branches or pull requests

2 participants