From 6582bf8d40ee95cc9df6a5acc7602d61b73a5457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Wed, 9 Nov 2022 16:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9SQL=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=97=A0=E5=85=B3=E7=B4=A7=E8=A6=81=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/export/export_sql_generator.js | 2 +- netease_music/sql/statistic.sql | 40 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/netease_music/sql/export/export_sql_generator.js b/netease_music/sql/export/export_sql_generator.js index 1d2b76c..2c1cda4 100644 --- a/netease_music/sql/export/export_sql_generator.js +++ b/netease_music/sql/export/export_sql_generator.js @@ -100,7 +100,7 @@ let outputArr = []; var a = fs.readFileSync(path.join(__dirname, `distribution_range/user.txt`), "utf-8").trim().split("\n").reverse().map(i => i.trim()); // a = a.filter((val, index) => index % 15 == 0); // 抽掉一些边界 不然SQL太多了 for (let i = 0; i < a.length; i++) { - outputArr.push(`start cmd /k "node index --utils comment --min ${a[i]} --max ${a[i + 1]} --limit 10000";`); + outputArr.push(`start cmd /k "node index --utils comment --min ${a[i]} --max ${a[i + 1]} --limit 10000"`); } outputArr.push("echo done."); console.log(outputArr.join('\n')); diff --git a/netease_music/sql/statistic.sql b/netease_music/sql/statistic.sql index b7f7e4a..82dfaec 100644 --- a/netease_music/sql/statistic.sql +++ b/netease_music/sql/statistic.sql @@ -55,68 +55,68 @@ INSERT IGNORE INTO wait_check_album (id) SELECT album_id FROM song_album_rela -- 查看需要爬取的 song 的分布 -SELECT cast( format( id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count FROM wait_fetch_song GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看需要爬取的 album 的分布 -SELECT cast( format( id / 1000000, 0) * 1000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( id / 1000000 ) * 1000000 as UNSIGNED ) as s, count(*) as count FROM wait_fetch_album GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看需要爬取的 artist 的分布 -SELECT cast( format( id / 100000, 0) * 100000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR(id / 100000 ) * 100000 as UNSIGNED ) as s, count(*) as count FROM wait_fetch_artist GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看需要爬取的 comment 的分布 -SELECT cast( format( song_id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( song_id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count FROM comment_progress WHERE current_status != 2 GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看需要爬取的 lyric 的分布 -SELECT cast( format( id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count FROM wait_fetch_lyric GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看本地已有 song 的分布 -SELECT cast( format( song_id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( song_id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count FROM song GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看本地已有 user 的分布 -SELECT cast( format( user_id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( user_id / 10000000 ) * 10000000 as UNSIGNED ) as s, count(*) as count FROM user GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看本地已有 album 的分布 -SELECT cast( format( album_id / 1000000, 0) * 1000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( album_id / 1000000 ) * 1000000 as UNSIGNED ) as s, count(*) as count FROM album GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看本地已有 artist 的分布 -SELECT cast( format( artist_id / 2000000, 0) * 2000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( artist_id / 2000000 ) * 2000000 as UNSIGNED ) as s, count(*) as count FROM artist GROUP BY s -ORDER BY s DESC +ORDER BY s DESC; -- 查看本地已有 playlist 的分布 -SELECT cast( format( playlist_id / 2000000, 0) * 2000000 as UNSIGNED ) as s, count(*) as count +SELECT cast( FLOOR( playlist_id / 2000000 ) * 2000000 as UNSIGNED ) as s, count(*) as count FROM playlist GROUP BY s -ORDER BY s DESC +ORDER BY s DESC;