explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Tjz

Settings
# exclusive inclusive rows x rows loops node
1. 6,121.613 140,037.823 ↑ 7.2 18,724,421 1

Unique (cost=40,095,560.86..45,484,903.82 rows=134,733,574 width=123) (actual time=129,282.290..140,037.823 rows=18,724,421 loops=1)

2. 21,967.405 133,916.210 ↑ 6.5 20,798,830 1

Sort (cost=40,095,560.86..40,432,394.79 rows=134,733,574 width=123) (actual time=129,282.289..133,916.210 rows=20,798,830 loops=1)

  • Sort Key: challans.id, challans.remark, challans.challan_no, challans.challan_doc_no, challans.date_time, challans.challan_place, challans.ac
  • Sort Method: external merge Disk: 3089112kB
3. 5,188.191 111,948.805 ↑ 6.5 20,798,830 1

Hash Join (cost=3,746,490.86..15,652,950.18 rows=134,733,574 width=123) (actual time=25,740.759..111,948.805 rows=20,798,830 loops=1)

  • Hash Cond: (challans.officer_id = users.id)
4. 18,781.984 106,686.042 ↑ 2.6 20,798,891 1

Hash Join (cost=3,739,449.83..14,966,354.29 rows=55,071,125 width=112) (actual time=25,665.692..106,686.042 rows=20,798,891 loops=1)

  • Hash Cond: (challan_accused.challan_id = challan_status.challan_id)
5. 62,314.030 81,276.565 ↑ 1.0 18,074,851 1

Hash Join (cost=3,176,440.89..12,978,456.52 rows=18,690,068 width=107) (actual time=19,025.384..81,276.565 rows=18,074,851 loops=1)

  • Hash Cond: ((challan_accused.challan_id = challans.id) AND ((challan_accused.type)::text = (challans.accused_type)::text))
  • -> Seq Scan on challan_accused (cost=0.00..8260043.41 rows=67122136 width=25) (actual time=0.102..27162.881 rows=61107820
6. 18,962.535 18,962.535 ↑ 1.0 18,078,905 1

Hash (cost=2,756,055.28..2,756,055.28 rows=18,561,327 width=89) (actual time=18,962.534..18,962.535 rows=18,078,905 loops=1)

  • Buckets: 1048576 Batches: 32 Memory Usage: 76594kB
  • -> Seq Scan on challans (cost=0.00..2756055.28 rows=18561327 width=89) (actual time=0.019..13652.013 rows=18079610
  • Filter: (is_active = 1)
  • Rows Removed by Filter: 64611
7. 6,627.493 6,627.493 ↓ 1.0 20,876,674 1

Hash (cost=346,613.92..346,613.92 rows=20,841,640 width=13) (actual time=6,627.493..6,627.493 rows=20,876,674 loops=1)

  • Buckets: 4194304 Batches: 16 Memory Usage: 94022kB
  • -> Seq Scan on challan_status (cost=0.00..346613.92 rows=20841640 width=13) (actual time=0.025..3682.553 rows=20876674 lo
8. 9.827 74.572 ↑ 2.5 37,174 1

Hash (cost=6,538.86..6,538.86 rows=91,302 width=11) (actual time=74.572..74.572 rows=37,174 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 2709kB
9. 64.420 64.745 ↑ 2.5 37,174 1

Nested Loop (cost=0.29..6,538.86 rows=91,302 width=11) (actual time=0.648..64.745 rows=37,174 loops=1)

  • -> Index Scan using users_location_idx on users (cost=0.29..3.15 rows=46 width=8) (actual time=0.005..0.030 rows=19 loops
10. 0.325 0.325 ↑ 1.0 1,977 1

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

  • Index Cond: ((location)::text = ((rto.id)::character varying)::text)
Planning time : 5.276 ms
Execution time : 141,089.976 ms