explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6gxG

Settings
# exclusive inclusive rows x rows loops node
1. 1.918 6,444.176 ↑ 1.0 1 1

Aggregate (cost=883,274.10..883,274.13 rows=1 width=4) (actual time=6,444.176..6,444.176 rows=1 loops=1)

2. 485.318 6,442.258 ↑ 3.3 24,415 1

Hash Join (cost=70,612.01..883,074.34 rows=79,904 width=4) (actual time=428.264..6,442.258 rows=24,415 loops=1)

  • Hash Cond: (challans.id = challan_in_court.challan_id)
3. 115.864 5,628.154 ↓ 1.3 1,608,416 1

Nested Loop (cost=1.01..805,400.63 rows=1,244,148 width=4) (actual time=0.214..5,628.154 rows=1,608,416 loops=1)

4. 0.326 5.824 ↑ 1.6 1,778 1

Nested Loop (cost=0.57..2,444.67 rows=2,808 width=4) (actual time=0.178..5.824 rows=1,778 loops=1)

5. 0.233 0.233 ↑ 1.7 39 1

Index Scan using rto_state_code_id_idx on rto (cost=0.28..35.66 rows=66 width=4) (actual time=0.133..0.233 rows=39 loops=1)

  • Index Cond: ((state_code)::text = 'TN'::text)
  • Filter: (type = 2)
  • Rows Removed by Filter: 146
6. 5.265 5.265 ↓ 1.1 46 39

Index Scan using users_location_idx on users (cost=0.29..35.21 rows=43 width=8) (actual time=0.011..0.135 rows=46 loops=39)

  • Index Cond: ((location)::text = ((rto.id)::character varying)::text)
7. 5,506.466 5,506.466 ↑ 2.6 905 1,778

Index Scan using idx_challans_officer_id on challans (cost=0.43..214.10 rows=2,395 width=8) (actual time=0.009..3.097 rows=905 loops=1,778)

  • Index Cond: (officer_id = users.id)
8. 146.481 328.786 ↓ 1.0 959,681 1

Hash (cost=39,642.92..39,642.92 rows=952,864 width=8) (actual time=328.786..328.786 rows=959,681 loops=1)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 45,197kB
9. 182.305 182.305 ↓ 1.0 959,682 1

Seq Scan on challan_in_court (cost=0.00..39,642.92 rows=952,864 width=8) (actual time=0.012..182.305 rows=959,682 loops=1)

Planning time : 2.417 ms
Execution time : 6,445.037 ms