12345678910111213141516171819202122232425262728293031 |
- --查看入库表大小
- select sdate,rat,sum(l4_dl_throughput +l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
- from sqmdb_bak.sdrflow_daily
- where rat in ('6','9') group by sdate,rat;
- --手动创建分区
- --select sqmdb_bak.sdrflow_partition_daily();
- --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');
- --CREATE INDEX "sqmdb_bak.sdrflow_daily_20220801_sdate" ON sqmdb_bak.sdrflow_daily_20220801 USING btree(sdate);
- --查看分区表大小
- select relname,pg_size_pretty(pg_relation_size(relid))
- from pg_stat_user_tables
- where schemaname='sqmdb_bak' and relname like '%sdrflow_daily%' order by relname desc;
- select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
- from o2p.sdr_0_4g_flow_cell_day group by sdate order by sdate desc
- select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
- from o2p.sdr_0_4g_flow_enb_day group by sdate order by sdate desc
- select sdate,count(*),sum(l4_dw_throughput+l4_ul_throughput)/1024/1024/1024/1024 as flow_tb
- from o2p.sdr_2_5g_flow_cell_day group by sdate order by sdate desc
- select sdate,count(*),sum(dl_throughput_m+ul_throughput_m)/1024/1024/1024/1024 as flow_tb
- from o2p.sdr_1_5g_flow_base_day group by sdate order by sdate desc
|