explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4nWA

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

Sort (cost=7,571,282.00..7,571,382.00 rows=40,000 width=834) (actual rows= loops=)

  • Sort Key: intervals.intrvl
2.          

CTE sessions

3. 0.000 0.000 ↓ 0.0

Unique (cost=50,930.94..50,938.93 rows=1,597 width=50) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Sort (cost=50,930.94..50,934.93 rows=1,598 width=50) (actual rows= loops=)

  • Sort Key: project_sessions.session_id
5. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on project_sessions (cost=681.27..50,845.91 rows=1,598 width=50) (actual rows= loops=)

  • Recheck Cond: ((project_id)::text = 'corebo00000000000md1pd5eom9idr5o'::text)
  • Filter: (("timestamp" >= '2019-01-01 00:00:00'::timestamp without time zone) AND ("timestamp" <= '2019-02-06 00:00:00'::timestamp without time zone) AND ((event)::text = 'add'::text))
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_project_sessions_project_id (cost=0.00..680.87 rows=16,575 width=0) (actual rows= loops=)

  • Index Cond: ((project_id)::text = 'corebo00000000000md1pd5eom9idr5o'::text)
7.          

CTE intervals

8. 0.000 0.000 ↓ 0.0

Function Scan on intervalize (cost=0.25..10.25 rows=1,000 width=192) (actual rows= loops=)

9.          

CTE ivr_sessions

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,460,299.50..6,673,132.41 rows=2,366,425 width=95) (actual rows= loops=)

  • Hash Cond: ((sessions.ses)::text = (impl_ivr_flow_log.session_id)::text)
11. 0.000 0.000 ↓ 0.0

CTE Scan on sessions (cost=0.00..31.94 rows=1,597 width=146) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash (cost=3,315,040.22..3,315,040.22 rows=79,019,622 width=95) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on impl_ivr_flow_log (cost=0.00..3,315,040.22 rows=79,019,622 width=95) (actual rows= loops=)

14.          

CTE first_transf

15. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=13,696.80..14,243.74 rows=1,886 width=99) (actual rows= loops=)

  • Group Key: qc.session_id
16. 0.000 0.000 ↓ 0.0

Sort (cost=13,696.80..13,701.52 rows=1,886 width=83) (actual rows= loops=)

  • Sort Key: qc.session_id
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..13,594.19 rows=1,886 width=83) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

CTE Scan on sessions sessions_1 (cost=0.00..31.94 rows=1,597 width=146) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Scan using idx_qc_session_id on queued_calls qc (cost=0.56..8.48 rows=1 width=83) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (sessions_1.ses)::text)
20.          

CTE predetail

21. 0.000 0.000 ↓ 0.0

Result (cost=109,131.73..781,174.84 rows=1,708 width=438) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Sort (cost=109,131.73..109,136.00 rows=1,708 width=132) (actual rows= loops=)

  • Sort Key: qc_1.enqueued_time
23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=282.44..109,040.03 rows=1,708 width=132) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=281.88..17,259.05 rows=1,253 width=107) (actual rows= loops=)

  • Hash Cond: ((qc_1.session_id)::text = (first_transf.session_id)::text)
25. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on queued_calls qc_1 (cost=220.58..16,898.59 rows=1,253 width=59) (actual rows= loops=)

  • Recheck Cond: ((project_id)::text = 'corebo00000000000md1pd5eom9idr5o'::text)
  • Filter: ((enqueued_time >= '2019-01-01 00:00:00'::timestamp without time zone) AND (enqueued_time <= '2019-02-06 00:00:00'::timestamp without time zone))
26. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_qc_project_id (cost=0.00..220.27 rows=5,295 width=0) (actual rows= loops=)

  • Index Cond: ((project_id)::text = 'corebo00000000000md1pd5eom9idr5o'::text)
27. 0.000 0.000 ↓ 0.0

Hash (cost=37.72..37.72 rows=1,886 width=194) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

CTE Scan on first_transf (cost=0.00..37.72 rows=1,886 width=194) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Index Scan using idx_call_legs_session_id on call_legs calllength (cost=0.56..73.19 rows=6 width=75) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (qc_1.session_id)::text)
  • Filter: (leg_id = 1)
30.          

SubPlan (forResult)

31. 0.000 0.000 ↓ 0.0

Index Scan using mq_interact_sid on impl_mq_interaction_log imil (cost=0.42..8.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (qc_1.session_id)::text)
  • Filter: (((function_id)::text = 'SearchClientInfo'::text) AND ((((respbody -> 'data'::text) -> 'searchClientInfoResponse'::text) ->> 'clientID'::text) IS NOT NULL))
32. 0.000 0.000 ↓ 0.0

Seq Scan on impl_mq_interaction_log imil_1 (cost=0.00..16,047.00 rows=1,043 width=32) (actual rows= loops=)

  • Filter: (((function_id)::text = 'SearchClientInfo'::text) AND ((((respbody -> 'data'::text) -> 'searchClientInfoResponse'::text) ->> 'clientID'::text) IS NOT NULL))
33. 0.000 0.000 ↓ 0.0

Index Scan using mq_interact_sid on impl_mq_interaction_log imil_2 (cost=0.42..8.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (qc_1.session_id)::text)
  • Filter: (((function_id)::text = ANY ('{GetCardFinInfo,GetContractFinInfo}'::text[])) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer = 0))
34. 0.000 0.000 ↓ 0.0

Seq Scan on impl_mq_interaction_log imil_3 (cost=0.00..16,671.00 rows=1 width=32) (actual rows= loops=)

  • Filter: (((function_id)::text = ANY ('{GetCardFinInfo,GetContractFinInfo}'::text[])) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer = 0))
35. 0.000 0.000 ↓ 0.0

Index Scan using mq_interact_sid on impl_mq_interaction_log imil_4 (cost=0.42..8.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (qc_1.session_id)::text)
  • Filter: (((function_id)::text = ANY ('{GetCardFinInfo,GetContractFinInfo}'::text[])) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer <> 0))
36. 0.000 0.000 ↓ 0.0

Seq Scan on impl_mq_interaction_log imil_5 (cost=0.00..16,671.00 rows=103 width=32) (actual rows= loops=)

  • Filter: (((function_id)::text = ANY ('{GetCardFinInfo,GetContractFinInfo}'::text[])) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer <> 0))
37. 0.000 0.000 ↓ 0.0

CTE Scan on ivr_sessions iifl (cost=0.00..62,118.66 rows=177 width=0) (actual rows= loops=)

  • Filter: (((session_id)::text = (qc_1.session_id)::text) AND (node_id = ANY ('{ivr/fin_info_closed.iscr-ef14cb91852c4dbcb5fff5a583e12fa5,ivr/fin_info_closed.iscr-f9ce5cf1f04943b18b9e187e51b471b1,ivr/fin_info_closed.iscr-2e19bfd191d64204a4b98063417d6a25}'::text[])))
38. 0.000 0.000 ↓ 0.0

CTE Scan on ivr_sessions iifl_1 (cost=0.00..56,202.59 rows=35,496 width=32) (actual rows= loops=)

  • Filter: (node_id = ANY ('{ivr/fin_info_closed.iscr-ef14cb91852c4dbcb5fff5a583e12fa5,ivr/fin_info_closed.iscr-f9ce5cf1f04943b18b9e187e51b471b1,ivr/fin_info_closed.iscr-2e19bfd191d64204a4b98063417d6a25}'::text[]))
39. 0.000 0.000 ↓ 0.0

Index Scan using mq_interact_sid on impl_mq_interaction_log imil_6 (cost=0.42..8.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((session_id)::text = (qc_1.session_id)::text)
  • Filter: (((function_id)::text = 'SetCardBlock'::text) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer = 0))
40. 0.000 0.000 ↓ 0.0

Seq Scan on impl_mq_interaction_log imil_7 (cost=0.00..16,671.00 rows=1 width=32) (actual rows= loops=)

  • Filter: (((function_id)::text = 'SetCardBlock'::text) AND (((((respbody -> 'header'::text) -> 'resultInfo'::text) ->> 'code'::text))::integer = 0))
41. 0.000 0.000 ↓ 0.0

Index Scan using queued_calls_pkey on queued_calls qc3 (cost=0.43..8.45 rows=1 width=33) (actual rows= loops=)

  • Index Cond: (id = first_transf.min_id)
42.          

CTE detail

43. 0.000 0.000 ↓ 0.0

CTE Scan on predetail (cost=0.00..68.32 rows=1,708 width=990) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

HashAggregate (cost=47,955.97..48,655.97 rows=40,000 width=834) (actual rows= loops=)

  • Group Key: intervals.intrvl, 'buddy'::text, detail.incom_number, detail.authorized_client_word, NULL::text, NULL::character varying
45. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..42,737.08 rows=189,778 width=944) (actual rows= loops=)

  • Join Filter: ((detail.enqueued_time >= intervals.p_begin) AND (detail.enqueued_time <= intervals.p_end))
46. 0.000 0.000 ↓ 0.0

CTE Scan on intervals (cost=0.00..20.00 rows=1,000 width=192) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

CTE Scan on detail (cost=0.00..34.16 rows=1,708 width=680) (actual rows= loops=)