From eccd9f590a9f49236a416c345cd68385e18cad5a Mon Sep 17 00:00:00 2001 From: shish Date: Wed, 4 Jul 2007 15:53:44 +0000 Subject: [PATCH] tag query optimisation, now made simple, because mysql is speshal git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.0@218 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/database.class.php b/core/database.class.php index f43b3ecb..fc955362 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -129,7 +129,7 @@ class Database { } else if(count($tag_search->variables) == 1 && $positive_tag_count == 1) { $query = new Querylet( - "SELECT * FROM images WHERE images.id IN (SELECT image_id FROM tags WHERE tag = ?) ", + "SELECT *,UNIX_TIMESTAMP(posted) AS posted_timestamp FROM tags, images WHERE tag LIKE ? AND tags.image_id = images.id ", $tag_search->variables); if(strlen($img_search->sql) > 0) {