- 1086 Verbindungen, 20,3 Mio Datensätze, 1 Monat Laufzeit (14.7.09-13.8.09) - Plot im Tagesverlauf: # create temporary table tc_temp select this_ip, other_ip, count(*) as `count`, stddev(lq) as stddev from tc group by this_ip, other_ip; # create unique index `this_ip-other_ip` on tc_temp (this_ip, other_ip); # mysql> select hour(time) as dhour, avg(lq), stddev(lq) from tc left join tc_temp using (this_ip, other_ip) where (tc_temp.count >= 10000) and (tc_temp.stddev >= 0.1) group by dhour order by dhour; +-------+-----------+------------+ | dhour | avg(lq) | stddev(lq) | +-------+-----------+------------+ | 0 | 0.6084682 | 0.2683932 | | 1 | 0.6112864 | 0.2690906 | | 2 | 0.6183908 | 0.2663158 | | 3 | 0.6192398 | 0.2663380 | | 4 | 0.6211201 | 0.2659874 | | 5 | 0.6199165 | 0.2665641 | | 6 | 0.6170703 | 0.2669435 | | 7 | 0.6080200 | 0.2691067 | | 8 | 0.6054532 | 0.2701683 | | 9 | 0.5975714 | 0.2720965 | | 10 | 0.5873787 | 0.2729625 | | 11 | 0.5830587 | 0.2727117 | | 12 | 0.5785262 | 0.2729187 | | 13 | 0.5791762 | 0.2726120 | | 14 | 0.5812393 | 0.2734477 | | 15 | 0.5823949 | 0.2727396 | | 16 | 0.5830660 | 0.2717456 | | 17 | 0.5823185 | 0.2706872 | | 18 | 0.5813215 | 0.2693063 | | 19 | 0.5825870 | 0.2691086 | | 20 | 0.5803082 | 0.2716080 | | 21 | 0.5856379 | 0.2686569 | | 22 | 0.5937129 | 0.2673735 | | 23 | 0.6022797 | 0.2657363 | +-------+-----------+------------+ 24 rows in set (4 min 50.68 sec) mysql> select hour(time) as dhour, avg(lq), stddev(lq), avg(lq-tc_temp.avg), stddev(lq-tc_temp.avg) from tc left join tc_temp using (this_ip, other_ip) where (tc_temp.count >= 10000) and (tc_temp.stddev >= 0.1) group by dhour order by dhour; +-------+-----------+------------+---------------------+------------------------+ | dhour | avg(lq) | stddev(lq) | avg(lq-tc_temp.avg) | stddev(lq-tc_temp.avg) | +-------+-----------+------------+---------------------+------------------------+ | 0 | 0.6084682 | 0.2683932 | 0.01252244585 | 0.17568923984 | | 1 | 0.6112864 | 0.2690906 | 0.01547282873 | 0.17630030896 | | 2 | 0.6183908 | 0.2663158 | 0.02173625242 | 0.17614946005 | | 3 | 0.6192398 | 0.2663380 | 0.02312030275 | 0.17645740466 | | 4 | 0.6211201 | 0.2659874 | 0.02522323930 | 0.17625728725 | | 5 | 0.6199165 | 0.2665641 | 0.02301139951 | 0.17508211775 | | 6 | 0.6170703 | 0.2669435 | 0.01897508743 | 0.17386436450 | | 7 | 0.6080200 | 0.2691067 | 0.01036953886 | 0.17231283762 | | 8 | 0.6054532 | 0.2701683 | 0.00849586855 | 0.16881092752 | | 9 | 0.5975714 | 0.2720965 | 0.00297912759 | 0.16797825233 | | 10 | 0.5873787 | 0.2729625 | -0.00662588438 | 0.16515164940 | | 11 | 0.5830587 | 0.2727117 | -0.01190826417 | 0.16455961677 | | 12 | 0.5785262 | 0.2729187 | -0.01594070809 | 0.16473581130 | | 13 | 0.5791762 | 0.2726120 | -0.01598482687 | 0.16514565406 | | 14 | 0.5812393 | 0.2734477 | -0.01505623317 | 0.16762641792 | | 15 | 0.5823949 | 0.2727396 | -0.01399198327 | 0.16629140469 | | 16 | 0.5830660 | 0.2717456 | -0.01414539025 | 0.16784383466 | | 17 | 0.5823185 | 0.2706872 | -0.01566616290 | 0.17160533364 | | 18 | 0.5813215 | 0.2693063 | -0.01779721290 | 0.17293167540 | | 19 | 0.5825870 | 0.2691086 | -0.01606542679 | 0.17429548809 | | 20 | 0.5803082 | 0.2716080 | -0.01916193874 | 0.17684469869 | | 21 | 0.5856379 | 0.2686569 | -0.01256553590 | 0.17661032556 | | 22 | 0.5937129 | 0.2673735 | -0.00446026742 | 0.17681868266 | | 23 | 0.6022797 | 0.2657363 | 0.00576817335 | 0.17597542784 | +-------+-----------+------------+---------------------+------------------------+ 24 rows in set (5 min 18.36 sec) mysql> select hour(time) as dhour, min(lq-tc_temp.avg), max(lq-tc_temp.avg) from tc left join tc_temp using (this_ip, other_ip) where (tc_temp.count >= 10000) and (tc_temp.stddev >= 0.1) group by dhour order by dhour; +-------+---------------------+---------------------+ | dhour | min(lq-tc_temp.avg) | max(lq-tc_temp.avg) | +-------+---------------------+---------------------+ | 0 | -0.9833922 | 0.6986340 | | 1 | -0.9833922 | 0.7106340 | | 2 | -0.9833922 | 0.6986340 | | 3 | -0.9833922 | 0.6711897 | | 4 | -0.9833922 | 0.7101897 | | 5 | -0.9833922 | 0.7101897 | | 6 | -0.9401066 | 0.6596340 | | 7 | -0.9833922 | 0.6831897 | | 8 | -0.9833922 | 0.6911897 | | 9 | -0.9563922 | 0.6831897 | | 10 | -0.9833922 | 0.6631897 | | 11 | -0.9833922 | 0.5811897 | | 12 | -0.9833922 | 0.5731897 | | 13 | -0.9833922 | 0.6117001 | | 14 | -0.9833922 | 0.6897001 | | 15 | -0.9647454 | 0.6627001 | | 16 | -0.9833922 | 0.6817001 | | 17 | -0.9833922 | 0.7207001 | | 18 | -0.9833922 | 0.7097001 | | 19 | -0.9833922 | 0.6676340 | | 20 | -0.9443922 | 0.7106340 | | 21 | -0.9647454 | 0.6941312 | | 22 | -0.9833922 | 0.6676340 | | 23 | -0.9833922 | 0.7092330 | +-------+---------------------+---------------------+ 24 rows in set (4 min 48.15 sec)