[mythtv-commits] Ticket #7946: Add SQL indexes to crossreferenced data in MythVideo
MythTV
mythtv at cvs.mythtv.org
Fri Jan 22 17:24:22 UTC 2010
#7946: Add SQL indexes to crossreferenced data in MythVideo
--------------------------------+-------------------------------------------
Reporter: wagnerrp | Owner: awithers
Type: enhancement | Status: new
Priority: minor | Milestone: 0.23
Component: Plugin - MythVideo | Version: head
Severity: low | Mlocked: 0
--------------------------------+-------------------------------------------
This patch adds indexes to the videometadatacast, videometadatagenre, and
videometadatacountry tables. This allows searches for videos containing a
list of actors to be performed in a reasonable time (1.33 seconds vs.
10min before I killed mysql). This is to allow an improvement over a
search in the new Python bindings which is only capable of search of one
cast member.
SELECT videometadata.*
FROM videometadata
WHERE (SELECT COUNT(DISTINCT videocast.cast)
FROM videometadatacast
JOIN videocast
ON videocast.intid=videometadatacast.idcast
WHERE videometadatacast.idvideo=videometadata.intid
AND ( videocast.cast='Nathan Lane'
OR videocast.cast='Meg Gillentine')
) = 2;
Thanks to kormoc for the SQL.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/7946>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list