explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dpjr

Settings
# exclusive inclusive rows x rows loops node
1. 377.212 124,078.154 ↓ 0.0 0 1

Insert on billing.billing_event_software_download (cost=16.72..35.97 rows=1 width=1,388) (actual time=124,078.154..124,078.154 rows=0 loops=1)

  • Buffers: shared hit=99,110,802 read=867 dirtied=771
2. 111.071 123,700.942 ↓ 19,221.0 19,221 1

Nested Loop Left Join (cost=16.72..35.97 rows=1 width=1,388) (actual time=768.243..123,700.942 rows=19,221 loops=1)

  • Output: nextval('billing.billing_event_software_download_id_seq'::regclass), '2020-07-30 19:00:00'::timestamp without time zone, '1'::bigint, '4'::bigint, NULL::character varying(40), cc.related_org_id, client_org.name, client_org.tems_customer_number, cust.id, cust.gl_legal_entity, cust.gl_cust_no, cust.name, 1.00::numeric(10,2), el.id, el.org_id, org.name, el.device_id, el.device_sn, el.event_execution_dtt, el.dataset_name, el.dataset_version, el.create_dtt
  • Join Filter: (dst.software_download_id = el.id)
  • Filter: (dst.id IS NULL)
  • Buffers: shared hit=99,013,853 read=97
3. 39.022 2,151.593 ↓ 19,221.0 19,221 1

Nested Loop (cost=16.58..27.80 rows=1 width=1,242) (actual time=768.150..2,151.593 rows=19,221 loops=1)

  • Output: el.id, el.org_id, el.device_id, el.device_sn, el.event_execution_dtt, el.dataset_name, el.dataset_version, el.create_dtt, org.name, cc.related_org_id, client_org.name, client_org.tems_customer_number, cust.id, cust.gl_legal_entity, cust.gl_cust_no, cust.name
  • Inner Unique: true
  • Buffers: shared hit=213,499 read=97
4. 420.344 2,035.687 ↓ 19,221.0 19,221 1

Nested Loop (cost=16.31..26.21 rows=1 width=1,199) (actual time=768.130..2,035.687 rows=19,221 loops=1)

  • Output: el.id, el.org_id, el.device_id, el.device_sn, el.event_execution_dtt, el.dataset_name, el.dataset_version, el.create_dtt, org.name, cc.related_org_id, client_org.name, client_org.tems_customer_number, client_org.bill_to_customer_id
  • Join Filter: (org.id = el.org_id)
  • Rows Removed by Join Filter: 1,172,481
  • Buffers: shared hit=155,836 read=97
5. 0.164 1.111 ↓ 62.0 62 1

Hash Join (cost=15.89..17.75 rows=1 width=51) (actual time=0.924..1.111 rows=62 loops=1)

  • Output: org.name, org.id, cc.related_org_id, cc.org_id, client_org.name, client_org.tems_customer_number, client_org.bill_to_customer_id
  • Hash Cond: (client_org.id = cc.related_org_id)
  • Buffers: shared hit=3
6. 0.042 0.042 ↑ 1.0 62 1

Seq Scan on users.organization client_org (cost=0.00..1.62 rows=62 width=31) (actual time=0.006..0.042 rows=62 loops=1)

  • Output: client_org.id, client_org.name, client_org.parent_id, client_org.enabled, client_org.location_id, client_org.tems_customer_number, client_org.bill_to_customer_id, client_org.exclusivity, client_org.hsm_slot, client_org.agreement_accepted_ts, client_org.heart_beat_period, client_org.monitor_my_terminals, client_org.idp_version, client_org.sales_director_name, client_org.sales_director_email, client_org.sales_admin_name, client_org.sales_admin_email
  • Buffers: shared hit=1
7. 0.036 0.905 ↓ 62.0 62 1

Hash (cost=15.88..15.88 rows=1 width=24) (actual time=0.905..0.905 rows=62 loops=1)

  • Output: org.name, org.id, cc.related_org_id, cc.org_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=2
8. 0.104 0.869 ↓ 62.0 62 1

Hash Join (cost=14.02..15.88 rows=1 width=24) (actual time=0.805..0.869 rows=62 loops=1)

  • Output: org.name, org.id, cc.related_org_id, cc.org_id
  • Hash Cond: (org.id = cc.org_id)
  • Buffers: shared hit=2
9. 0.016 0.016 ↑ 1.0 62 1

Seq Scan on users.organization org (cost=0.00..1.62 rows=62 width=16) (actual time=0.005..0.016 rows=62 loops=1)

  • Output: org.id, org.name, org.parent_id, org.enabled, org.location_id, org.tems_customer_number, org.bill_to_customer_id, org.exclusivity, org.hsm_slot, org.agreement_accepted_ts, org.heart_beat_period, org.monitor_my_terminals, org.idp_version, org.sales_director_name, org.sales_director_email, org.sales_admin_name, org.sales_admin_email
  • Buffers: shared hit=1
10. 0.034 0.749 ↓ 62.0 62 1

Hash (cost=14.00..14.00 rows=1 width=8) (actual time=0.748..0.749 rows=62 loops=1)

  • Output: cc.related_org_id, cc.org_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=1
11. 0.056 0.715 ↓ 62.0 62 1

Subquery Scan on cc (cost=8.67..14.00 rows=1 width=8) (actual time=0.220..0.715 rows=62 loops=1)

  • Output: cc.related_org_id, cc.org_id
  • Filter: (cc.rr = 1)
  • Rows Removed by Filter: 102
  • Buffers: shared hit=1
12. 0.419 0.659 ↑ 1.0 164 1

WindowAgg (cost=8.67..11.95 rows=164 width=20) (actual time=0.219..0.659 rows=164 loops=1)

  • Output: mv_org_tree.org_id, mv_org_tree.related_org_id, rank() OVER (?), mv_org_tree.distance
  • Buffers: shared hit=1
13. 0.172 0.240 ↑ 1.0 164 1

Sort (cost=8.67..9.08 rows=164 width=12) (actual time=0.212..0.240 rows=164 loops=1)

  • Output: mv_org_tree.org_id, mv_org_tree.distance, mv_org_tree.related_org_id
  • Sort Key: mv_org_tree.org_id, mv_org_tree.distance
  • Sort Method: quicksort Memory: 32kB
  • Buffers: shared hit=1
14. 0.068 0.068 ↑ 1.0 164 1

Seq Scan on users.mv_org_tree (cost=0.00..2.64 rows=164 width=12) (actual time=0.012..0.068 rows=164 loops=1)

  • Output: mv_org_tree.org_id, mv_org_tree.distance, mv_org_tree.related_org_id
  • Buffers: shared hit=1
15. 1,614.232 1,614.232 ↓ 19,221.0 19,221 62

Index Scan using _temp_idx_event_log on mgmtplan.event_log el (cost=0.42..8.45 rows=1 width=1,156) (actual time=0.145..26.036 rows=19,221 loops=62)

  • Output: el.id, el.org_id, el.device_id, el.device_sn, el.event_execution_dtt, el.result, el.dataset_name, el.dataset_type, el.dataset_version, el.addl_error_info, el.dataset_create_dtt, el.action_type, el.management_action_id, el.device_history_id, el.device_history_dtt, el.device_history_device_event_type, el.device_history_org_id, el.device_history_device_id2, el.device_history_serial_number, el.device_history_cpu_id, el.device_history_lane_id, el.device_history_device_state_id, el.device_history_type_id, el.device_history_store_id, el.device_history_timezone, el.device_history_timezone_source, el.device_history_online, el.device_history_store_name, el.device_history_org_name, el.device_history_user_scd_id, el.device_history_login_id, el.device_history_first_name, el.device_history_last_name, el.create_dtt
  • Index Cond: (((el.action_type)::text = 'DWNL'::text) AND ((el.dataset_type)::text = 'SWPK'::text) AND ((el.result)::text = 'SUCC'::text) AND (el.create_dtt >= '2000-01-01 00:00:00'::timestamp without time zone) AND (el.create_dtt < '2020-08-01 00:00:00'::timestamp without time zone))
  • Buffers: shared hit=155,833 read=97
16. 76.884 76.884 ↑ 1.0 1 19,221

Index Scan using customer_pkey on users.customer cust (cost=0.28..1.58 rows=1 width=51) (actual time=0.004..0.004 rows=1 loops=19,221)

  • Output: cust.id, cust.gl_legal_entity, cust.gl_cust_no, cust.name, cust.address, cust.address_2, cust.city, cust.postal_code, cust.blocked, cust.sim_auto_activation, cust.sim_activate_graceperiod_days, cust.sim_suspend_requests, cust.sim_suspend_days_max, cust.sim_guaranteed_cycle_max, cust.single_multi_src_invoice_ind, cust.create_dtt, cust.last_upd_dtt, cust.payment_terms_code
  • Index Cond: (cust.id = client_org.bill_to_customer_id)
  • Buffers: shared hit=57,663
17. 0.000 121,438.278 ↓ 0.0 0 19,221

Append (cost=0.14..8.16 rows=1 width=16) (actual time=6.318..6.318 rows=0 loops=19,221)

  • Buffers: shared hit=98,781,122
18. 121,438.278 121,438.278 ↓ 0.0 0 19,221

Index Scan using billing_event_software_downlo_billing_cycle_id_cycle_run_d_idx3 on billing.billing_event_software_download_p2020_07 dst (cost=0.14..8.16 rows=1 width=16) (actual time=6.318..6.318 rows=0 loops=19,221)

  • Output: dst.software_download_id, dst.id
  • Index Cond: ((dst.billing_cycle_id = '1'::bigint) AND (dst.cycle_run_dtt = '2020-07-30 19:00:00'::timestamp without time zone))
  • Buffers: shared hit=98,781,122