]> git.decadent.org.uk Git - memories.git/commitdiff
JOIN optimization.
authorSimon Cozens <simon@simon-cozens.org>
Thu, 5 Apr 2007 05:08:33 +0000 (05:08 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 5 Apr 2007 05:08:33 +0000 (05:08 +0000)
git-svn-id: http://svn.simon-cozens.org/memories/trunk@56 041978f6-d955-411f-a9d7-1d8545c9c3c7

Memories/SystemTag.pm
Memories/Tag.pm

index cdb8e14169bb9d360f57977a3f92ccb86a994f50..3a9fbbf1de72f6ee1d9d8f2ea272bddb6ddcfe5d 100644 (file)
@@ -6,10 +6,9 @@ __PACKAGE__->table("system_tag");
 
 Memories::Photo->set_sql(sorted_by_system_tag => q/
 SELECT photo.id as id, title, uploader, uploaded, x, y
-FROM photo, system_tag, system_tagging
+FROM photo, system_tagging
 WHERE system_tagging.photo = photo.id
-    AND system_tagging.tag = system_tag.id
-    AND system_tag.id = ?
+    AND system_tagging.tag = ?
 ORDER BY photo.uploaded DESC
 /
 );
index 59df4df80e0812fd71849ed3222271ea5321e2bc..744a98a089e49af7da5fff6192c99f4cf7865a7f 100644 (file)
@@ -5,10 +5,9 @@ __PACKAGE__->columns(Essential => qw/id name/);
 
 Memories::Photo->set_sql(sorted_by_tag => q/
 SELECT photo.id as id, title, uploader, uploaded, x, y
-FROM photo, tag, tagging
+FROM photo, tagging
 WHERE tagging.photo = photo.id
-    AND tagging.tag = tag.id
-    AND tag.id = ?
+    AND tagging.tag = ?
 ORDER BY photo.uploaded DESC
 /
 );