explain.depesz.com

PostgreSQL's explain analyze made readable

Result: h0u

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

Group (cost=1,572,721.46..1,572,737.57 rows=1,289 width=48) (actual rows= loops=)

  • Output: ((logged_actions.row_data -> 'causedBy'::text)), li.line_item_id, di.delivery_id
  • Group Key: di.delivery_id, li.line_item_id, ((logged_actions.row_data -> 'causedBy'::text))
2. 0.000 0.000 ↓ 0.0

Sort (cost=1,572,721.46..1,572,724.68 rows=1,289 width=48) (actual rows= loops=)

  • Output: ((logged_actions.row_data -> 'causedBy'::text)), li.line_item_id, di.delivery_id
  • Sort Key: di.delivery_id DESC, li.line_item_id, ((logged_actions.row_data -> 'causedBy'::text))
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=613,998.21..1,572,654.87 rows=1,289 width=48) (actual rows= loops=)

  • Output: (logged_actions.row_data -> 'causedBy'::text), li.line_item_id, di.delivery_id
  • Hash Cond: (li.sender_contact_information_id = di.sender_contact_information_id)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..935,848.36 rows=280,887 width=275) (actual rows= loops=)

  • Output: li.line_item_id, li.sender_contact_information_id, logged_actions.row_data
  • Inner Unique: true
5. 0.000 0.000 ↓ 0.0

Index Scan using logged_actions_action_idx on audit.logged_actions (cost=0.57..266,645.03 rows=280,887 width=259) (actual rows= loops=)

  • Output: logged_actions.event_id, logged_actions.schema_name, logged_actions.table_name, logged_actions.relid, logged_actions.session_user_name, logged_actions.action_tstamp_tx, logged_actions.action_tstamp_stm, logged_actions.action_tstamp_clk, logged_actions.transaction_id, logged_actions.application_name, logged_actions.client_addr, logged_actions.client_port, logged_actions.client_query, logged_actions.action, logged_actions.row_data, logged_actions.changed_fields, logged_actions.statement_only
  • Index Cond: (logged_actions.table_name = 'line_items'::text)
6. 0.000 0.000 ↓ 0.0

Index Scan using pk_line_items on public.line_items li (cost=0.57..2.38 rows=1 width=16) (actual rows= loops=)

  • Output: li.line_item_id, li.sender_contact_information_id
  • Index Cond: (li.line_item_id = ((logged_actions.row_data -> 'line_item_id'::text))::bigint)
7. 0.000 0.000 ↓ 0.0

Hash (cost=610,824.04..610,824.04 rows=182,482 width=16) (actual rows= loops=)

  • Output: di.delivery_id, di.sender_contact_information_id
8. 0.000 0.000 ↓ 0.0

Seq Scan on public.deliveries di (cost=0.00..610,824.04 rows=182,482 width=16) (actual rows= loops=)

  • Output: di.delivery_id, di.sender_contact_information_id
  • Filter: ((di.initiated_by IS NULL) AND (di.created_at >= '2019-02-04 00:00:00+00'::timestamp with time zone) AND ((di.delivery_type)::text = 'EMAIL_RESEND'::text) AND ((di.status)::text = 'SENT'::text))