blob: 3207aa2c22e84a3039bb4deb0326d7e5735447e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
vacuum verbose analyze stat_t (i1,i2);
--
--
select i2,sum(b) as b
into tmp
from stat_t
where i1 >= '144.206.0.0' and i1 <= '144.206.255.255'
group by i2;
insert into tmp
select '0.0.0.0' as i2,sum(b) as k
from tmp
where b < 10 * 1024;
delete from tmp
where b < 10 * 1024 and i2 <> '0.0.0.0';
select i2,b / 1024 as k from tmp
order by k desc;
select ipaddr_print(i2,'%A/%P'),b from tmp where i2 = '0.0.0.0';
drop table tmp;
explain select i2,sum(b) as b
into tmp
from stat_t
where i1 >= '144.206.0.0' and i1 <= '144.206.255.255'
group by i2;
-- ********************************************************
-- * Now remove test table by 'drop table stat_t' command *
-- ********************************************************
|