Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> explain SELECT * FROM tvshowview WHERE (tvshowview.idShow IN (select tvshowview.idShow from tvshowview where (watchedcount > 0 AND watchedcount < totalCount) OR (watchedcount = 0 AND tvshowview.idShow IN (select episodeview.idShow from episodeview WHERE episodeview.idShow = tvshowview.idShow AND episodeview.resumeTimeInSeconds > 0))));
- +----+--------------------+----------------+--------+------------------------------------+---------------------+---------+-------------------------------------------------+------+--------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+--------------------+----------------+--------+------------------------------------+---------------------+---------+-------------------------------------------------+------+--------------------------+
- | 1 | PRIMARY | <derived4> | ALL | NULL | NULL | NULL | NULL | 175 | Using where |
- | 4 | DERIVED | tvshow | ALL | NULL | NULL | NULL | NULL | 173 | Using filesort |
- | 4 | DERIVED | tvshowlinkpath | ref | ix_tvshowlinkpath_1 | ix_tvshowlinkpath_1 | 5 | MyVideos75.tvshow.idShow | 1 | Using index |
- | 4 | DERIVED | path | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.tvshowlinkpath.idPath | 1 | |
- | 4 | DERIVED | episode | ref | ix_episode_show2 | ix_episode_show2 | 5 | MyVideos75.tvshow.idShow | 24 | |
- | 4 | DERIVED | files | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.episode.idFile | 1 | |
- | 2 | DEPENDENT SUBQUERY | <derived5> | ALL | NULL | NULL | NULL | NULL | 175 | Using where |
- | 5 | DERIVED | tvshow | ALL | NULL | NULL | NULL | NULL | 173 | Using filesort |
- | 5 | DERIVED | tvshowlinkpath | ref | ix_tvshowlinkpath_1 | ix_tvshowlinkpath_1 | 5 | MyVideos75.tvshow.idShow | 1 | Using index |
- | 5 | DERIVED | path | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.tvshowlinkpath.idPath | 1 | |
- | 5 | DERIVED | episode | ref | ix_episode_show2 | ix_episode_show2 | 5 | MyVideos75.tvshow.idShow | 24 | |
- | 5 | DERIVED | files | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.episode.idFile | 1 | |
- | 3 | DEPENDENT SUBQUERY | episode | ref | id_episode_file_2,ix_episode_show2 | ix_episode_show2 | 5 | func | 24 | Using where |
- | 3 | DEPENDENT SUBQUERY | tvshow | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.episode.idShow | 1 | Using index |
- | 3 | DEPENDENT SUBQUERY | bookmark | ref | ix_bookmark | ix_bookmark | 10 | MyVideos75.episode.idFile,const | 1 | Using where |
- | 3 | DEPENDENT SUBQUERY | seasons | ref | ix_seasons | ix_seasons | 10 | MyVideos75.tvshow.idShow,MyVideos75.episode.c12 | 1 | Using index |
- | 3 | DEPENDENT SUBQUERY | files | eq_ref | PRIMARY,ix_files | PRIMARY | 4 | MyVideos75.episode.idFile | 1 | |
- | 3 | DEPENDENT SUBQUERY | path | eq_ref | PRIMARY | PRIMARY | 4 | MyVideos75.files.idPath | 1 | Using where; Using index |
- +----+--------------------+----------------+--------+------------------------------------+---------------------+---------+-------------------------------------------------+------+--------------------------+
- 18 rows in set (0.92 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement