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

[venus-market] opt slow sql / 慢查询优化 #5645

Closed
1 of 11 tasks
hunjixin opened this issue Jan 10, 2023 · 1 comment · Fixed by ipfs-force-community/droplet#294
Closed
1 of 11 tasks

[venus-market] opt slow sql / 慢查询优化 #5645

hunjixin opened this issue Jan 10, 2023 · 1 comment · Fixed by ipfs-force-community/droplet#294
Assignees
Labels
C-enhancement Category: feature enhancement P2 Medium - we should get to this soon V-venus-market venus-market component

Comments

@hunjixin
Copy link
Contributor

链服务模块 / Chain Service Components

  • venus
  • venus-auth
  • venus-gateway
  • venus-messager
  • venus-miner
  • 文档 / docs

订单服务模块 / Deal Service Components

  • venus-market
  • 文档 / docs

算力服务模块 / Storage Power Service Components

  • venus-sector-manager
  • venus-worker
  • 文档 / docs

描述 / Description

SELECT * FROM storage_deals WHERE cdp_provider = '0522948' AND state IN (7)
当该表数据较多时该sql执行比较耗时(参考:扫描1k行需要3~10秒),建议添加个联合索引:
ALTER TABLE venus_market.storage_deals ADD INDEX idx_cdpprovider_state (cdp_provider, state)

@hunjixin hunjixin added P2 Medium - we should get to this soon V-venus-market venus-market component C-enhancement Category: feature enhancement labels Jan 10, 2023
@Fatman13 Fatman13 changed the title [venus-market] 慢查询优化 / opt slow sql [venus-market] opt slow sql / 慢查询优化 Jan 11, 2023
@simlecode simlecode self-assigned this Mar 8, 2023
@simlecode
Copy link
Collaborator

storage_deals 表增加索引:CREATE INDEX idx_cdpprovider_state ON storage_deals(cdp_provider,state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: feature enhancement P2 Medium - we should get to this soon V-venus-market venus-market component
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants