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;
|
my $date_format = $self->date_format;
|
||||||
|
|
||||||
$self->pg->db->query(<<~'END_SQL', $date_format)->hashes;
|
$self->pg->db->query(<<~'END_SQL', $date_format)->hashes;
|
||||||
SELECT t.thread_id AS id,
|
SELECT thread_id AS id,
|
||||||
TO_CHAR(t.thread_date, ?) AS date,
|
TO_CHAR(thread_date, ?) AS date,
|
||||||
t.thread_author AS author,
|
thread_author AS author,
|
||||||
t.thread_title AS title,
|
thread_title AS title,
|
||||||
t.thread_body AS body,
|
thread_body AS body
|
||||||
COUNT(r.*) AS remark_count,
|
FROM threads
|
||||||
t.bump_tally AS bump_tally
|
WHERE NOT hidden_status
|
||||||
FROM threads AS t
|
GROUP BY thread_id
|
||||||
LEFT JOIN remarks AS r
|
ORDER BY thread_date DESC
|
||||||
ON t.thread_id = r.thread_id
|
|
||||||
WHERE NOT t.hidden_status
|
|
||||||
GROUP BY t.thread_id
|
|
||||||
ORDER BY t.thread_date DESC
|
|
||||||
LIMIT 15;
|
LIMIT 15;
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user