explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MIAB

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.008 2,818.664 ↓ 10.0 10 1

Limit (cost=25,400.57..25,400.57 rows=1 width=24) (actual time=2,818.657..2,818.664 rows=10 loops=1)

2. 1.058 2,818.656 ↓ 10.0 10 1

Sort (cost=25,400.57..25,400.57 rows=1 width=24) (actual time=2,818.655..2,818.656 rows=10 loops=1)

  • Sort Key: pv.createdtime DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 5.447 2,817.598 ↓ 12,159.0 12,159 1

WindowAgg (cost=23,921.26..25,400.56 rows=1 width=24) (actual time=2,816.236..2,817.598 rows=12,159 loops=1)

4. 77.289 2,812.151 ↓ 12,159.0 12,159 1

Nested Loop (cost=23,921.26..25,400.54 rows=1 width=16) (actual time=419.920..2,812.151 rows=12,159 loops=1)

5. 110.018 2,538.278 ↓ 954.3 196,584 1

Nested Loop (cost=23,920.98..25,335.72 rows=206 width=24) (actual time=419.807..2,538.278 rows=196,584 loops=1)

6. 131.720 1,838.502 ↓ 720.1 196,586 1

Nested Loop (cost=23,920.56..25,062.47 rows=273 width=24) (actual time=419.791..1,838.502 rows=196,586 loops=1)

  • Join Filter: (od.id = pv.id)
7. 0.000 1,095.436 ↓ 437.3 203,782 1

Nested Loop (cost=23,920.14..24,660.01 rows=466 width=16) (actual time=419.771..1,095.436 rows=203,782 loops=1)

8. 126.630 489.946 ↓ 147.1 205,531 1

HashAggregate (cost=23,919.71..23,933.68 rows=1,397 width=8) (actual time=419.742..489.946 rows=205,531 loops=1)

  • Group Key: od_1.id
9. 127.495 363.316 ↓ 147.1 205,531 1

Hash Join (cost=15,263.75..23,916.22 rows=1,397 width=8) (actual time=206.120..363.316 rows=205,531 loops=1)

  • Hash Cond: ((od_1.offernumber = tblofferdata.offernumber) AND ((od_1.offerversion)::bigint = (max((tblofferdata.offerversion)::bigint))))
10. 30.013 30.013 ↓ 1.0 279,388 1

Seq Scan on tblofferdata od_1 (cost=0.00..7,115.85 rows=279,385 width=21) (actual time=0.016..30.013 rows=279,388 loops=1)

11. 39.308 205.808 ↓ 1.3 205,512 1

Hash (cost=12,969.16..12,969.16 rows=152,973 width=19) (actual time=205.808..205.808 rows=205,512 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 13287kB
12. 136.394 166.500 ↓ 1.3 205,512 1

HashAggregate (cost=9,909.70..11,439.43 rows=152,973 width=19) (actual time=114.825..166.500 rows=205,512 loops=1)

  • Group Key: tblofferdata.offernumber
13. 30.106 30.106 ↓ 1.0 279,388 1

Seq Scan on tblofferdata (cost=0.00..7,115.85 rows=279,385 width=13) (actual time=0.015..30.106 rows=279,388 loops=1)

14. 616.593 616.593 ↑ 1.0 1 205,531

Index Scan using tblofferdata_pkey on tblofferdata od (cost=0.42..0.52 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=205,531)

  • Index Cond: (id = od_1.id)
  • Filter: ((validstartdate + validdays) < now())
  • Rows Removed by Filter: 0
15. 611.346 611.346 ↑ 1.0 1 203,782

Index Scan using tblpolicyversion_pkey on tblpolicyversion pv (cost=0.42..0.85 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=203,782)

  • Index Cond: (id = od_1.id)
  • Filter: ((canceldate IS NULL) AND (policyversionstatus = 'CURRENT'::text))
  • Rows Removed by Filter: 0
16. 589.758 589.758 ↑ 1.0 1 196,586

Index Scan using pk_tblinsurance on tblpolicy p (cost=0.42..1.00 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=196,586)

  • Index Cond: (id = pv.idpolicy)
  • Filter: (policytype = 'OFFER'::text)
  • Rows Removed by Filter: 0
17. 196.584 196.584 ↓ 0.0 0 196,584

Index Scan using tblagencyunit_pkey on tblagencyunit agency (cost=0.28..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=196,584)

  • Index Cond: (id = p.idagency)
  • Filter: ((ltree2text(subltree(path, 0, 1)))::integer = 2375)
  • Rows Removed by Filter: 1
Planning time : 2.351 ms
Execution time : 2,819.731 ms