Don't need the JOIN anymore
This commit is contained in:
parent
57de51b29c
commit
fe19848b51
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user