explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1GIZ : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #88f1; plan #8l1n; plan #WF1s; plan #IQfk; plan #h6JT; plan #nlUg

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 3,462.863 21,144.087 ↓ 1.9 82,486 1

Index Scan using campaigns_actionworkflowitemstatus_status_302e976e_uniq on campaigns_actionworkflowitemstatus (cost=0.43..9,335,885.49 rows=43,906 width=64) (actual time=197.482..21,144.087 rows=82,486 loops=1)

  • Index Cond: (status = ANY ('{51,400,407,410,411,420}'::integer[]))
  • Filter: (id = (SubPlan 2))
  • Rows Removed by Filter: 8,716,883
  • JIT:
  • Functions: 18
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 0.888 ms, Inlining 31.477 ms, Optimization 34.526 ms, Emission 30.879 ms, Total 97.771 ms
2.          

SubPlan (for Index Scan)

3. 0.000 82.486 ↑ 1.0 1 82,486

Limit (cost=0.56..1.02 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=82,486)

4. 82.486 82.486 ↑ 5.0 1 82,486

Index Only Scan using campaigns_actionworkflowitemstatus_awi_created_at_id_idx on campaigns_actionworkflowitemstatus u0 (cost=0.56..2.85 rows=5 width=16) (actual time=0.001..0.001 rows=1 loops=82,486)

  • Index Cond: (action_workflow_item_id = campaigns_actionworkflowitemstatus.action_workflow_item_id)
  • Heap Fetches: 49,019
5. 0.000 17,598.738 ↑ 1.0 1 8,799,369

Limit (cost=0.56..1.02 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=8,799,369)

6. 17,598.738 17,598.738 ↑ 5.0 1 8,799,369

Index Only Scan using campaigns_actionworkflowitemstatus_awi_created_at_id_idx on campaigns_actionworkflowitemstatus u0_1 (cost=0.56..2.85 rows=5 width=16) (actual time=0.002..0.002 rows=1 loops=8,799,369)

  • Index Cond: (action_workflow_item_id = campaigns_actionworkflowitemstatus.action_workflow_item_id)
  • Heap Fetches: 298,493
Planning time : 0.134 ms
Execution time : 21,148.575 ms