QUERY PLAN
Aggregate (cost=89.82..89.83 rows=1 width=8)
-> Sort (cost=89.80..89.81 rows=1 width=324)
Sort Key: p.is_draft DESC, p.has_following_work DESC, p.end_at DESC
-> Group (cost=89.79..89.79 rows=1 width=324)
Group Key: p.id
-> Sort (cost=89.79..89.79 rows=1 width=14)
Sort Key: p.id
-> Seq Scan on tbl_pre_sales p (cost=0.00..89.78 rows=1 width=14)
Filter: (case_id = 8693)