CC-3331: Optimize "Now Playing" to load in less than 1/2 second

- cleaned up sql statement Schedule's getScheduleItemsInRange
This commit is contained in:
Daniel 2012-02-17 17:08:47 -05:00
parent 5dd94ce12c
commit c7f4b17e81
1 changed files with 4 additions and 4 deletions

View File

@ -313,13 +313,13 @@ class Application_Model_Schedule {
." si.id as instance_id,"
." pt.name as playlist_name"
." FROM ".$CC_CONFIG["showInstances"]." si"
." LEFT JOIN ".$CC_CONFIG[scheduleTable]." st"
." LEFT JOIN ".$CC_CONFIG["scheduleTable"]." st"
." ON st.instance_id = si.id"
." LEFT JOIN ".$CC_CONFIG[playListTable]." pt"
." LEFT JOIN ".$CC_CONFIG["playListTable"]." pt"
." ON st.playlist_id = pt.id"
." LEFT JOIN ".$CC_CONFIG[filesTable]." ft"
." LEFT JOIN ".$CC_CONFIG["filesTable"]." ft"
." ON st.file_id = ft.id"
." LEFT JOIN ".$CC_CONFIG[showTable]." s"
." LEFT JOIN ".$CC_CONFIG["showTable"]." s"
." ON si.show_id = s.id"
." WHERE ((si.starts < TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends > TIMESTAMP '$timeNow' - INTERVAL '$start seconds')"
." OR (si.starts > TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends < TIMESTAMP '$timeNow' + INTERVAL '$end seconds')"