Code Monkey home page Code Monkey logo

mysql_tools's Introduction

MySQL_Tools

  • delete_cold_data

用於刪除過期的資料 ,也可以選擇刪除前先備份到同庫的his表中

-- 使用自動模式刪除 ,並在刪除前 ,先備份到users_login_log_his表中
insert into dba_delete_data(db_name ,tb_name ,tb_type ,time_condition ,time_condition_operator ,keep_day,other_condition ,delete_per ,sleep_second)
values('users' ,'users_login_log' ,1 ,'log_dt' ,'auto' ,62 ,'' ,1000 ,0.1) ;

-- cold / his
insert into dba_cold_data(db_name ,source_table ,target_table ,time_condition ,migrate_day_ago ,batch_per ,sleep_second)
values('users' ,'users_login_log' ,'users_login_log_his' ,'gmt_created' ,365 ,10000 ,0.1) ;

-- 使用自定義的刪除條件方式
insert into dba_delete_data(db_name ,tb_name ,tb_type ,time_condition ,time_condition_operator ,time_condition_format ,keep_day,other_condition ,delete_per ,sleep_second)
values('transaction' ,'transaction_record' ,1 ,'record_id' ,' in ' ,'(select record_id from transaction_record_finished where created_date<= date_sub(current_date() ,interval 63 day) )' ,7 ,'' ,1000 ,0.1) ;
  • qps_monitor

mysql_tools's People

Contributors

jerrylin0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.