use tidb_block_browser;
-- select count(1) from tb_block where block_id >= @blocknum or block_id >= (@blocknum - 10000) ;
select count(1) from tb_block where block_id >= @blocknum ;

-- select * from tb_verify_code limit 1;
-- select * from tb_validator_snapshot limit 1;
-- select * from tb_user_api_key limit 1;
-- select * from tb_user limit 1;
-- 
-- 
delete from tb_transaction where block_id >= @blocknum;
-- select * from tb_token_price limit 1;
-- select * from tb_pending_block limit 1;
-- select * from tb_pending_block where block_id >= @blocknum;
-- 
-- select * from tb_original_transaction limit 1;
delete from tb_original_transaction where block_id >= @blocknum;
-- 
-- select * from tb_original_block limit 1;
delete from tb_original_block where block_id >= @blocknum;
-- 
-- 
-- select * from tb_internal_transaction limit 1;
delete from tb_internal_transaction where block_id >= @blocknum;
-- 
-- 
-- select * from tb_forked_block limit 1;
delete from tb_forked_block where block_id >= @blocknum;
-- select * from tb_event limit 1;
delete from tb_event where block_id >= @blocknum;
-- 
-- select * from tb_contract_transaction limit 1;
delete from tb_contract_transaction where block_id >= @blocknum;
-- 
-- select * from tb_contract_function limit 1;
-- select * from tb_contract_account order by block_id desc limit 1;
delete from tb_contract_account where block_id >= @blocknum;
-- 
-- select * from tb_contract order by block_id desc limit 10;
delete from tb_contract where block_id >= @blocknum;
-- select * from tb_config limit 1;
-- select * from tb_block_control;
update tb_block_control set last_analyze_block_id=(@blocknum-1) , write_block_id_lock=@blocknum;
-- select * from tb_block limit 1;
delete from tb_block where block_id >= @blocknum;
-- select * from tb_base_coin_price limit 1;
-- select * from tb_base_coin_info limit 1;
-- select * from tb_account_stats limit 1;
-- select * from tb_account_info limit 1;
delete from tb_account_info where block_id >= @blocknum;
