explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ajcq

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

Insert on stg_combined_incidents (cost=282,763.97..2,017,601.19 rows=10 width=841) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* (cost=282,763.97..2,017,601.19 rows=10 width=841) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Limit (cost=282,763.97..2,017,600.69 rows=10 width=120) (actual rows= loops=)

4.          

CTE get_agg_1

5. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=79,764.90..86,197.10 rows=257,288 width=37) (actual rows= loops=)

  • Group Key: cd.cdcomp
6. 0.000 0.000 ↓ 0.0

Sort (cost=79,764.90..80,408.12 rows=257,288 width=37) (actual rows= loops=)

  • Sort Key: cd.cdcomp
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=2.31..49,605.18 rows=257,288 width=37) (actual rows= loops=)

  • Hash Cond: (cd.z_z_disposition_cad_incident_dispositions = cid.cad_incident_dispositionsid)
8. 0.000 0.000 ↓ 0.0

Seq Scan on caddspo cd (cost=0.00..43,703.00 rows=887,200 width=12) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=1.58..1.58 rows=58 width=33) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on cad_incident_dispositions cid (cost=0.00..1.58 rows=58 width=33) (actual rows= loops=)

  • Filter: (description IS NOT NULL)
11.          

Initplan (forLimit)

12. 0.000 0.000 ↓ 0.0

Seq Scan on cad_incident_code_mod_types (cost=0.00..1.04 rows=1 width=8) (actual rows= loops=)

  • Filter: ((code)::text = 'A'::text)
13. 0.000 0.000 ↓ 0.0

Seq Scan on cad_incidents_status_types (cost=0.00..1.05 rows=1 width=8) (actual rows= loops=)

  • Filter: ((abbreviation)::text = 'C'::text)
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=196,564.77..458,953,506,491.10 rows=2,645,513 width=120) (actual rows= loops=)

  • Join Filter: (addr.cadaddr_zid = pt_a.convertedid)
15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=196,564.35..25,470,388,512.27 rows=2,645,513 width=120) (actual rows= loops=)

  • Join Filter: (((cc.cftkrk)::numeric = ct.key_num) AND (((cc.cftkre)::bigint)::numeric = ct.badge_num))
16. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=196,564.35..25,378,959,430.59 rows=2,645,513 width=130) (actual rows= loops=)

  • Join Filter: (((cc.cfusrk)::numeric = d.key_num) AND (((cc.cfusre)::bigint)::numeric = d.badge_num))
17. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=196,564.35..25,287,530,348.91 rows=2,645,513 width=140) (actual rows= loops=)

  • Join Filter: (cc.cfcomp = agg1.cdcomp)
18. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=196,564.35..1,771,201.29 rows=2,645,513 width=76) (actual rows= loops=)

  • Hash Cond: (cc.cfcomp = addr.cacomp)
19. 0.000 0.000 ↓ 0.0

Seq Scan on cadcall cc (cost=0.00..508,890.13 rows=2,645,513 width=68) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=155,893.49..155,893.49 rows=2,339,668 width=16) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on cadaddr addr (cost=0.00..155,893.49 rows=2,339,668 width=16) (actual rows= loops=)

  • Filter: ((caatyp = '1'::numeric) AND (caaseq = '0'::numeric))
22. 0.000 0.000 ↓ 0.0

CTE Scan on get_agg_1 agg1 (cost=0.00..5,145.76 rows=257,288 width=96) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..155.28 rows=1,152 width=13) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on chfpemp d (cost=0.00..149.52 rows=1,152 width=13) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..155.28 rows=1,152 width=13) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Seq Scan on chfpemp ct (cost=0.00..149.52 rows=1,152 width=13) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..74,331.07 rows=1 width=12) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using pt_addresses_convertedid_wtrun_idx on pt_addresses pt_a (cost=0.43..74,331.07 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (wtrun = 106)
29.          

SubPlan (forNested Loop Left Join)

30. 0.000 0.000 ↓ 0.0

Limit (cost=45,921.01..45,921.01 rows=1 width=9) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Sort (cost=45,921.01..45,921.01 rows=1 width=9) (actual rows= loops=)

  • Sort Key: cd1.cdseq_num DESC
32. 0.000 0.000 ↓ 0.0

Seq Scan on caddspo cd1 (cost=0.00..45,921.00 rows=1 width=9) (actual rows= loops=)

  • Filter: (cdcomp = cc.cfcomp)
33. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..117,934.86 rows=1 width=4) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Seq Scan on cadtimes ct_1 (cost=0.00..707,609.17 rows=6 width=4) (actual rows= loops=)

  • Filter: ((ctcomp = cc.cfcomp) AND (ctstat = '11'::numeric))