New issue 243 by pascal.obry: optimize filter
http://code.google.com/p/vision2pixels/issues/detail?id=243
Today for properly filtering in last commented order we have a specific
trigger:
create trigger after_post_insert after insert on post
begin
update post
set last_comment_id=(select max(comment_id) from post_comment,
comment
where comment_id = comment.id
and post_comment.comment_id = comment_id
and comment.has_voted = "FALSE")
where id = new.id;
update forum
set last_activity=datetime(current_timestamp)
where forum.id =
(select category.forum_id
from category
where category.id = new.category_id);
end;
We probably want to add a last_updated timestamp in the post table and use
it. This should probably optimize some SQL statements.
Comment #1 on issue 243 by pascal.obry: optimize filter
http://code.google.com/p/vision2pixels/issues/detail?id=243
(No comment was entered for this change.)
Comment #2 on issue 243 by pascal.obry: optimize filter
Comment #4 on issue 243 by pascal.obry: optimize filter