I have quiet a few queries similar to this doing multiple Left Joins and they run extremely slow > 6 secs. Is there a better way to be writing the below query for sqlite.
SELECT a.id, a.title, a.type, a.dateAdded, a.url, a.path, a.containerID, a.mimeType, a.width, a.height, a.genreID, a.thumbnailID, a.releaseYearID, a.artistID, w.title AS containerName, x.title AS genreName, y.title AS releaseYearName, z.title AS artistName FROM mediaitem AS a LEFT JOIN mediaitem AS b ON b.containerID=a.containerID LEFT JOIN container AS w ON w.id=a.containerID LEFT JOIN container AS x ON x.id=a.genreID LEFT JOIN container AS y ON y.id=a.releaseYearID LEFT JOIN container AS z ON z.id=a.artistID WHERE a.type=1 AND b.type=0 AND b.title LIKE 'Opus%' ESCAPE '\' ORDER BY a.title, a.id LIMIT 0,9; Thanks, Andy This message is confidential to Prodea Systems, Inc unless otherwise indicated or apparent from its nature. This message is directed to the intended recipient only, who may be readily determined by the sender of this message and its contents. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient:(a)any dissemination or copying of this message is strictly prohibited; and(b)immediately notify the sender by return message and destroy any copies of this message in any form(electronic, paper or otherwise) that you have.The delivery of this message and its information is neither intended to be nor constitutes a disclosure or waiver of any trade secrets, intellectual property, attorney work product, or attorney-client communications. The authority of the individual sending this message to legally bind Prodea Systems is neither apparent nor implied,and must be independently verified. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users