1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

数据库添加索引;update

This commit is contained in:
2022-10-05 11:41:30 +08:00
parent 50d3555dd7
commit b35918faef
9 changed files with 159 additions and 95 deletions

View File

@@ -27,9 +27,9 @@ async function getFromDatabase({ songId }) {
async function fetchAll() {
console.log("start fetching songs ...");
var songIds = await dbUtils.query(`
SELECT DISTINCT song_id FROM song_artist_relation WHERE song_id NOT IN ( SELECT DISTINCT song_id FROM song )
SELECT DISTINCT song_id FROM song_artist_relation WHERE song_id NOT IN ( SELECT song_id FROM song )
UNION
SELECT DISTINCT song_id FROM song_album_relation WHERE song_id NOT IN ( SELECT DISTINCT song_id FROM song )
SELECT DISTINCT song_id FROM song_album_relation WHERE song_id NOT IN ( SELECT song_id FROM song )
`, []);
songIds = songIds.map(item => item.song_id);
for (let i = 0; i < songIds.length; i++) {