SDR汇聚表检查.sql 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. --查看入库表大小
  2. select sdate,rat,sum(l4_dl_throughput +l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
  3. from sqmdb_bak.sdrflow_daily
  4. where rat in ('6','9') group by sdate,rat;
  5. --手动创建分区
  6. --select sqmdb_bak.sdrflow_partition_daily();
  7. --CREATE TABLE sqmdb_bak.sdrflow_daily_20220801 PARTITION OF sqmdb_bak.sdrflow_daily FOR VALUES FROM ('2022-08-01 00:00:00') TO ('2022-08-02 00:00:00');
  8. --CREATE INDEX "sqmdb_bak.sdrflow_daily_20220801_sdate" ON sqmdb_bak.sdrflow_daily_20220801 USING btree(sdate);
  9. --查看分区表大小
  10. select relname,pg_size_pretty(pg_relation_size(relid))
  11. from pg_stat_user_tables
  12. where schemaname='sqmdb_bak' and relname like '%sdrflow_daily%' order by relname desc;
  13. select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
  14. from o2p.sdr_0_4g_flow_cell_day group by sdate order by sdate desc
  15. select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
  16. from o2p.sdr_0_4g_flow_enb_day group by sdate order by sdate desc
  17. select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
  18. from o2p.sdr_2_5g_flow_cell_day group by sdate order by sdate desc
  19. select sdate,count(*),sum(dl_throughput_m+ul_throughput_m)/1024/1024/1024/1024 as flow_tb
  20. from o2p.sdr_1_5g_flow_base_day group by sdate order by sdate desc