explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vSWx

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

Unique (cost=23,717,859.51..25,756,168.51 rows=50,957,725 width=123) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=23,717,859.51..23,845,253.82 rows=50,957,725 width=123) (actual rows= loops=)

  • Sort Key: challans.id, challans.remark, challans.challan_no, challans.challan_doc_no, challans.date_time, challans.challan_place, challans.ac
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,660,821.20..14,830,795.43 rows=50,957,725 width=123) (actual rows= loops=)

  • Hash Cond: (challans.officer_id = users.id)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,653,915.51..14,567,131.47 rows=20,776,952 width=112) (actual rows= loops=)

  • Hash Cond: (challans.id = challan_status.challan_id)
5. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=3,091,358.49..12,762,379.14 rows=17,967,320 width=103) (actual rows= loops=)

  • Hash Cond: ((challan_accused.challan_id = challans.id) AND ((challan_accused.type)::text = (challans.accused_type)::text))
6. 0.000 0.000 ↓ 0.0

Seq Scan on challan_accused (cost=0.00..8,243,307.42 rows=61,543,472 width=25) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=2,684,425.93..2,684,425.93 rows=17,967,320 width=89) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on challans (cost=0.00..2,684,425.93 rows=17,967,320 width=89) (actual rows= loops=)

  • Filter: (is_active = 1)
9. 0.000 0.000 ↓ 0.0

Hash (cost=346,039.24..346,039.24 rows=20,853,414 width=13) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on challan_status (cost=0.00..346,039.24 rows=20,853,414 width=13) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash (cost=6,406.10..6,406.10 rows=90,835 width=11) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=138.45..6,406.10 rows=90,835 width=11) (actual rows= loops=)

  • Merge Cond: ((users.location)::text = (((rto.id)::character varying)::text))
13. 0.000 0.000 ↓ 0.0

Index Scan using users_location_idx on users (cost=0.29..4,809.31 rows=37,036 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Sort (cost=138.16..143.11 rows=1,977 width=7) (actual rows= loops=)

  • Sort Key: (((rto.id)::character varying)::text)
15. 0.000 0.000 ↓ 0.0

Seq Scan on rto (cost=0.00..29.93 rows=1,977 width=7) (actual rows= loops=)