SQLite警告SubQuery上的自动索引

时间:2016-03-10 17:33:48

标签: c# sqlite

我有以下SQL

SELECT *
FROM Genres, GenreImages 
LEFT JOIN 
(SELECT SUM(Movies.PlayCount) AS SummedPlayCounts, MovieGenres.GenreId 
FROM Movies, MovieGenres 
WHERE Movies.Id = MovieGenres.MovieId 
GROUP BY MovieGenres.GenreId 
ORDER BY SummedPlayCounts DESC) AS GenreMoviesPlayCounts 
ON GenreMoviesPlayCounts.GenreId = Genre.Id 
WHERE GenreImages.GenreId = Genres.Id 
AND GenreImages.PrimaryImage = 1

它抛出

SQLite warning (284): automatic index on sqlite_sq_BD26FF8(GenreId)

MovieGenres.GenreId确实有一个索引,GenreImages.GenreId也是如此。此警告来自子查询GenreMoviesPlayCounts.GenreId = Genre.Id

有没有更好的方法来使用我现有的索引或不需要子查询?

0 个答案:

没有答案