explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uh3U

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=15,508.94..15,511.33 rows=959 width=687) (actual rows= loops=)

  • Sort Key: (CASE a.status WHEN 'TO_BE_COLLECTED'::text THEN 1 WHEN 'COLLECTED'::text THEN 2 WHEN 'REPAID'::text THEN 3 ELSE NULL::integer END), (CASE a.valid_record WHEN (NOT CASE_TEST_EXPR) THEN 1 WHEN CASE_TEST_EXPR THEN 2 ELSE NULL::integer END), a.update_time
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=13,757.98..15,461.44 rows=959 width=687) (actual rows= loops=)

  • Hash Cond: (a.work_group_id = e.id)
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=13,756.04..15,439.11 rows=959 width=163) (actual rows= loops=)

  • Hash Cond: (a.collector_id = d.id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=13,747.86..15,417.75 rows=959 width=160) (actual rows= loops=)

  • Hash Cond: (a.collection_id = b.id)
  • Filter: (((a.status)::text <> 'REPAID'::text) OR (((a.status)::text = 'REPAID'::text) AND (to_char(b.update_time, 'yyyy-MM-dd'::text) = to_char(now(), 'yyyy-MM-dd'::text))))
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11,516.25..13,156.33 rows=1,037 width=100) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

HashAggregate (cost=11,515.83..11,517.83 rows=200 width=8) (actual rows= loops=)

  • Group Key: max(t_collection_case.id)
7. 0.000 0.000 ↓ 0.0

HashAggregate (cost=11,171.42..11,324.49 rows=15,307 width=16) (actual rows= loops=)

  • Group Key: t_collection_case.collection_id
8. 0.000 0.000 ↓ 0.0

Seq Scan on t_collection_case (cost=0.00..10,262.56 rows=181,772 width=16) (actual rows= loops=)

  • Filter: valid_flag
9. 0.000 0.000 ↓ 0.0

Index Scan using t_collection_case_pkey on t_collection_case a (cost=0.42..8.18 rows=1 width=108) (actual rows= loops=)

  • Index Cond: (id = (max(t_collection_case.id)))
  • Filter: (collector_id = 100185)
10. 0.000 0.000 ↓ 0.0

Hash (cost=1,824.05..1,824.05 rows=32,605 width=76) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on t_collection b (cost=0.00..1,824.05 rows=32,605 width=76) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=8.16..8.16 rows=1 width=19) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using t_admin_pkey on t_admin d (cost=0.14..8.16 rows=1 width=19) (actual rows= loops=)

  • Index Cond: (id = 100185)
14. 0.000 0.000 ↓ 0.0

Hash (cost=1.42..1.42 rows=42 width=524) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on t_work_group e (cost=0.00..1.42 rows=42 width=524) (actual rows= loops=)