1. 项目目的
实现自动更新的可视化看板,满足业务人员自主分析的需求

2. 观察
数据字典 cmd观察数据库中数据
3. Python加工

四、添加数据索引
create index index_date on dw_order_by_day_hjf(create_date(4));
用日期中的年份做索引
select * from dw_order_by_day_hjf where create_date='2019-02-11';
查看运行时间
EXPLAIN select * from dw_order_by_day_hjf where create_date='2019-02-11';
查看索引执行
五、服务器部署代码,每日自动更新
import schedule
import time
import datetime
import os
import requests
def job1:
os.system("/home/anaconda3/bin/python3 /home/frog005/adventure/dw_order_by_day.py >> /home/frog005/adventure/hjf_logs/dw_order_by_day_schedule.log 2>&1 &")
schedule.every().day.at('06:00').do(job1)
While True:
schedule.run_pending()
time.sleep(10)
nohup python3 auto_update.py > auto_update.log 2>&1 &
六、 Power BI可视化
https://app.powerbi.com/groups/me/reports/7cd16dfe-7a15-4bb5-bbd4-29276e061451?ctid=774cc712-a5e8-4fae-8722-8ba584159783



网友评论