MySQLで遊ぶ [雑]
MySQLに大量データを登録して遊んでみる。 1500万件ぐらいのデータが欲しいのだけど、そんなの持ってないのでLinuxのカーネルソースを集計してつっこんでみた。 最新バージョンではないんだけどこんな感じになった。
ファイル数:
行数合計:
ファイル拡張子別の行数合計:
ファイル数:
mysql> select count(*) from linuxsrc; +----------+ | count(*) | +----------+ | 28248 | +----------+ 1 row in set (0.11 sec)
行数合計:
mysql> select sum(`lines`) from linuxsrc; +--------------+ | sum(`lines`) | +--------------+ | 10103874 | +--------------+ 1 row in set (0.11 sec)
ファイル拡張子別の行数合計:
mysql> select suffix, sum(`lines`) from v_linuxsrc group by suffix order by sum(`lines`) desc limit 10; +-----------+--------------+ | suffix | sum(`lines`) | +-----------+--------------+ | c | 7055695 | | h | 1777417 | | S | 295859 | | txt | 176625 | | Kconfig | 82228 | | dts | 26861 | | Makefile | 25586 | | tmpl | 21338 | | c_shipped | 18949 | | ppm | 18285 | +-----------+--------------+ 10 rows in set (9 min 20.68 sec)
コメント 0