diff --git a/lib/PostText/Model/Thread.pm b/lib/PostText/Model/Thread.pm index 872540c..cf2f0c1 100644 --- a/lib/PostText/Model/Thread.pm +++ b/lib/PostText/Model/Thread.pm @@ -101,19 +101,15 @@ sub feed($self) { my $date_format = $self->date_format; $self->pg->db->query(<<~'END_SQL', $date_format)->hashes; - SELECT t.thread_id AS id, - TO_CHAR(t.thread_date, ?) AS date, - t.thread_author AS author, - t.thread_title AS title, - t.thread_body AS body, - COUNT(r.*) AS remark_count, - t.bump_tally AS bump_tally - FROM threads AS t - LEFT JOIN remarks AS r - ON t.thread_id = r.thread_id - WHERE NOT t.hidden_status - GROUP BY t.thread_id - ORDER BY t.thread_date DESC + SELECT thread_id AS id, + TO_CHAR(thread_date, ?) AS date, + thread_author AS author, + thread_title AS title, + thread_body AS body + FROM threads + WHERE NOT hidden_status + GROUP BY thread_id + ORDER BY thread_date DESC LIMIT 15; END_SQL }