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

sql优化 #188

Open
lzdohh opened this issue Feb 2, 2024 · 0 comments
Open

sql优化 #188

lzdohh opened this issue Feb 2, 2024 · 0 comments

Comments

@lzdohh
Copy link

lzdohh commented Feb 2, 2024

执行时间20秒左右

select
    address, `type`, balance, restricting_balance, staking_value, delegate_value, redeemed_value, 
    tx_qty, transfer_qty, delegate_qty, staking_qty, proposal_qty, candidate_count, delegate_hes, 
    delegate_locked, delegate_released, contract_name, contract_create, contract_createHash, 
    contract_destroy_hash, create_time, update_time, have_reward, erc1155_tx_qty, erc721_tx_qty, erc20_tx_qty
from address
order by create_time limit 951000,1000

执行时间2秒左右

SELECT `address`.`address`, `address`.`type`, `address`.`balance`, `address`.`restricting_balance`, `address`.`staking_value`
 , `address`.`delegate_value`, `address`.`redeemed_value`, `address`.`tx_qty`, `address`.`transfer_qty`, `address`.`delegate_qty`
 , `address`.`staking_qty`, `address`.`proposal_qty`, `address`.`candidate_count`, `address`.`delegate_hes`, `address`.`delegate_locked`
 , `address`.`delegate_released`, `address`.`contract_name`, `address`.`contract_create`, `address`.`contract_createHash`, `address`.`contract_destroy_hash`
 , `address`.`create_time`, `address`.`update_time`, `address`.`have_reward`, `address`.`erc1155_tx_qty`, `address`.`erc721_tx_qty`
 , `address`.`erc20_tx_qty`
FROM `address`
 INNER JOIN (
  SELECT `address`
  FROM `address`
  ORDER BY `create_time`
  LIMIT 951000, 1000
 ) `tmp_0` USING (`address`);

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