QUERY PLAN
Aggregate (cost=87.07..87.08 rows=1 width=8)
-> Sort (cost=87.05..87.06 rows=1 width=324)
Sort Key: p.is_draft DESC, p.has_following_work DESC, p.end_at DESC
-> Group (cost=87.04..87.04 rows=1 width=324)
Group Key: p.id
-> Sort (cost=87.04..87.04 rows=1 width=14)
Sort Key: p.id
-> Seq Scan on tbl_pre_sales p (cost=0.00..87.03 rows=1 width=14)
Filter: (case_id = 8268)