explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1AoG

Settings
# exclusive inclusive rows x rows loops node
1. 1.450 14.889 ↓ 11.2 528 1

Merge Left Join (cost=713.84..926.08 rows=47 width=1,079) (actual time=8.258..14.889 rows=528 loops=1)

  • Output: c.id, c.c_sms_id, c.c_route_num, c.c_attempt, c.c_is_last, c.c_status, c.c_code, c.i_code, c.o_code, c.i_ip, c.o_ip, c.i_port, c.o_port, c.c_src_rtg_num, c.c_dst_rtg_num, c.c_lrn, c.c_rtg_num, c.c_dst_mccmnc, c.i_src_num, c.o_src_num, c.i_dst_num, c.o_dst_num, c.i_src_num_ton, c.o_src_num_ton, c.i_dst_num_ton, c.o_dst_num_ton, c.i_src_num_npi, c.o_src_num_npi, c.i_dst_num_npi, c.o_dst_num_npi, c.i_username, c.o_username, c.i_time, c.i_time_resp, c.o_time, c.o_time_resp, c.i_cust_id, c.o_vend_id, c.i_gw_id, c.o_gw_id, c.i_rate_plan_id, c.i_deck_id, c.i_area_id, c.o_rate_plan_id, c.i_rate_id, c.o_rate_id, c.i_route_plan_id, c.o_route_plan_id, c.i_rate_sys, c.o_rate_sys, c.i_currency, c.o_currency, c.i_rate, c.o_rate, c.o_dp_id, c.i_account_id, c.o_account_id, c.c_src_num, c.c_dst_num, c.c_src_lrn, c.c_dst_lrn, c.c_src_state, c.c_dst_state, c.c_src_lata, c.c_dst_lata, c.c_src_ocn, c.c_dst_ocn, c.i_seq, c.o_seq, c.i_ip_local, c.o_ip_local, c.i_port_local, c.o_port_local, c.i_message_id_c, c.o_message_id_c, c.c_sm_body, c.i_seq_ref_num, c.i_seq_total_segments, c.i_seq_segment_num, c.i_seq_id, c.c_tags, c.o_trunk_id, c.i_trunk_id, c.o_sm_body, c.o_route_id, c.o_prefix, c.o_tags, c.o_area_name, c.c_src_num_ton, c.c_src_num_npi, c.c_dst_num_ton, c.c_dst_num_npi, c.c_src_mccmnc, c.i_prefix, c.c_jurisdiction, 'c', NULL::unknown, (array_agg(d.state ORDER BY d.id)), (array_agg(d.id ORDER BY d.id)), c.i_message_id_c, c.o_message_id_c, (array_agg(COALESCE(d.dlr_in_time_dt, d.i_time_dt) ORDER BY d.id)), (array_agg(d.dlr_in_time_resp_dt ORDER BY d.id)), (array_agg((CASE WHEN (d.dlr_in_time_dt IS NULL) THEN 1 ELSE 0 END)::smallint ORDER BY d.id))
  • Merge Cond: (c.c_sms_id = d.sms)
  • Join Filter: (c.c_status = 3)
  • Buffers: shared hit=885
2. 0.841 2.248 ↓ 11.2 528 1

Sort (cost=293.88..294.00 rows=47 width=919) (actual time=2.110..2.248 rows=528 loops=1)

  • Output: c.id, c.c_sms_id, c.c_route_num, c.c_attempt, c.c_is_last, c.c_status, c.c_code, c.i_code, c.o_code, c.i_ip, c.o_ip, c.i_port, c.o_port, c.c_src_rtg_num, c.c_dst_rtg_num, c.c_lrn, c.c_rtg_num, c.c_dst_mccmnc, c.i_src_num, c.o_src_num, c.i_dst_num, c.o_dst_num, c.i_src_num_ton, c.o_src_num_ton, c.i_dst_num_ton, c.o_dst_num_ton, c.i_src_num_npi, c.o_src_num_npi, c.i_dst_num_npi, c.o_dst_num_npi, c.i_username, c.o_username, c.i_time, c.i_time_resp, c.o_time, c.o_time_resp, c.i_cust_id, c.o_vend_id, c.i_gw_id, c.o_gw_id, c.i_rate_plan_id, c.i_deck_id, c.i_area_id, c.o_rate_plan_id, c.i_rate_id, c.o_rate_id, c.i_route_plan_id, c.o_route_plan_id, c.i_rate_sys, c.o_rate_sys, c.i_currency, c.o_currency, c.i_rate, c.o_rate, c.o_dp_id, c.i_account_id, c.o_account_id, c.c_src_num, c.c_dst_num, c.c_src_lrn, c.c_dst_lrn, c.c_src_state, c.c_dst_state, c.c_src_lata, c.c_dst_lata, c.c_src_ocn, c.c_dst_ocn, c.i_seq, c.o_seq, c.i_ip_local, c.o_ip_local, c.i_port_local, c.o_port_local, c.i_message_id_c, c.o_message_id_c, c.c_sm_body, c.i_seq_ref_num, c.i_seq_total_segments, c.i_seq_segment_num, c.i_seq_id, c.c_tags, c.o_trunk_id, c.i_trunk_id, c.o_sm_body, c.o_route_id, c.o_prefix, c.o_tags, c.o_area_name, c.c_src_num_ton, c.c_src_num_npi, c.c_dst_num_ton, c.c_dst_num_npi, c.c_src_mccmnc, c.i_prefix, c.c_jurisdiction
  • Sort Key: c.c_sms_id
  • Sort Method: quicksort Memory: 557kB
  • Buffers: shared hit=85
3. 0.408 1.407 ↓ 11.2 528 1

Bitmap Heap Scan on smscdr.cdr_20200314 c (cost=117.10..292.57 rows=47 width=919) (actual time=1.022..1.407 rows=528 loops=1)

  • Output: c.id, c.c_sms_id, c.c_route_num, c.c_attempt, c.c_is_last, c.c_status, c.c_code, c.i_code, c.o_code, c.i_ip, c.o_ip, c.i_port, c.o_port, c.c_src_rtg_num, c.c_dst_rtg_num, c.c_lrn, c.c_rtg_num, c.c_dst_mccmnc, c.i_src_num, c.o_src_num, c.i_dst_num, c.o_dst_num, c.i_src_num_ton, c.o_src_num_ton, c.i_dst_num_ton, c.o_dst_num_ton, c.i_src_num_npi, c.o_src_num_npi, c.i_dst_num_npi, c.o_dst_num_npi, c.i_username, c.o_username, c.i_time, c.i_time_resp, c.o_time, c.o_time_resp, c.i_cust_id, c.o_vend_id, c.i_gw_id, c.o_gw_id, c.i_rate_plan_id, c.i_deck_id, c.i_area_id, c.o_rate_plan_id, c.i_rate_id, c.o_rate_id, c.i_route_plan_id, c.o_route_plan_id, c.i_rate_sys, c.o_rate_sys, c.i_currency, c.o_currency, c.i_rate, c.o_rate, c.o_dp_id, c.i_account_id, c.o_account_id, c.c_src_num, c.c_dst_num, c.c_src_lrn, c.c_dst_lrn, c.c_src_state, c.c_dst_state, c.c_src_lata, c.c_dst_lata, c.c_src_ocn, c.c_dst_ocn, c.i_seq, c.o_seq, c.i_ip_local, c.o_ip_local, c.i_port_local, c.o_port_local, c.i_message_id_c, c.o_message_id_c, c.c_sm_body, c.i_seq_ref_num, c.i_seq_total_segments, c.i_seq_segment_num, c.i_seq_id, c.c_tags, c.o_trunk_id, c.i_trunk_id, c.o_sm_body, c.o_route_id, c.o_prefix, c.o_tags, c.o_area_name, c.c_src_num_ton, c.c_src_num_npi, c.c_dst_num_ton, c.c_dst_num_npi, c.c_src_mccmnc, c.i_prefix, c.c_jurisdiction
  • Recheck Cond: ((c.i_time >= '2020-03-14 00:00:00'::timestamp without time zone) AND (c.i_time < '2020-03-14 01:00:00'::timestamp without time zone) AND (c.id > 16610283) AND (c.id <= 16620283))
  • Heap Blocks: exact=66
  • Buffers: shared hit=85
4. 0.019 0.999 ↓ 0.0 0 1

BitmapAnd (cost=117.10..117.10 rows=47 width=0) (actual time=0.999..0.999 rows=0 loops=1)

  • Buffers: shared hit=19
5. 0.145 0.145 ↑ 1.0 641 1

Bitmap Index Scan on smscdr_cdr_20200314_i_time (cost=0.00..18.87 rows=658 width=0) (actual time=0.145..0.145 rows=641 loops=1)

  • Index Cond: ((c.i_time >= '2020-03-14 00:00:00'::timestamp without time zone) AND (c.i_time < '2020-03-14 01:00:00'::timestamp without time zone))
  • Buffers: shared hit=5
6. 0.835 0.835 ↑ 1.0 4,561 1

Bitmap Index Scan on cdr_20200314_pkey (cost=0.00..97.96 rows=4,567 width=0) (actual time=0.835..0.835 rows=4,561 loops=1)

  • Index Cond: ((c.id > 16610283) AND (c.id <= 16620283))
  • Buffers: shared hit=14
7. 0.215 11.191 ↑ 9.8 372 1

Materialize (cost=419.96..622.74 rows=3,664 width=168) (actual time=6.097..11.191 rows=372 loops=1)

  • Output: d.sms, (array_agg(d.state ORDER BY d.id)), (array_agg(d.id ORDER BY d.id)), (array_agg(COALESCE(d.dlr_in_time_dt, d.i_time_dt) ORDER BY d.id)), (array_agg((CASE WHEN (d.dlr_in_time_dt IS NULL) THEN 1 ELSE 0 END)::smallint ORDER BY d.id)), (array_agg(d.dlr_in_time_resp_dt ORDER BY d.id))
  • Buffers: shared hit=800
8. 4.864 10.976 ↑ 9.8 372 1

GroupAggregate (cost=419.96..576.94 rows=3,664 width=42) (actual time=6.089..10.976 rows=372 loops=1)

  • Output: d.sms, array_agg(d.state ORDER BY d.id), array_agg(d.id ORDER BY d.id), array_agg(COALESCE(d.dlr_in_time_dt, d.i_time_dt) ORDER BY d.id), array_agg((CASE WHEN (d.dlr_in_time_dt IS NULL) THEN 1 ELSE 0 END)::smallint ORDER BY d.id), array_agg(d.dlr_in_time_resp_dt ORDER BY d.id)
  • Group Key: d.sms
  • Buffers: shared hit=800
9. 2.578 6.112 ↑ 9.8 379 1

Sort (cost=419.96..429.27 rows=3,727 width=42) (actual time=6.030..6.112 rows=379 loops=1)

  • Output: d.sms, d.state, d.id, d.dlr_in_time_dt, d.i_time_dt, d.dlr_in_time_resp_dt
  • Sort Key: d.sms
  • Sort Method: quicksort Memory: 390kB
  • Buffers: shared hit=800
10. 3.534 3.534 ↓ 1.0 3,754 1

Index Scan using dlr_20200314_pkey on smscdr.dlr_20200314 d (cost=0.29..198.88 rows=3,727 width=42) (actual time=0.036..3.534 rows=3,754 loops=1)

  • Output: d.sms, d.state, d.id, d.dlr_in_time_dt, d.i_time_dt, d.dlr_in_time_resp_dt
  • Index Cond: ((d.id > 16610283) AND (d.id <= 16620283))
  • Buffers: shared hit=800
Planning time : 0.934 ms
Execution time : 15.242 ms