explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V9fO

Settings
# exclusive inclusive rows x rows loops node
1. 6,530.808 6,530.808 ↓ 0.0 0 1

CTE Scan on schedule (cost=504,160.59..504,160.63 rows=2 width=12) (actual time=6,530.800..6,530.808 rows=0 loops=1)

2.          

CTE schedule

3. 0.007 6,530.806 ↓ 0.0 0 1

Update on dynamic_limit_schedule (cost=164,769.25..504,160.59 rows=2 width=100) (actual time=6,530.799..6,530.806 rows=0 loops=1)

4. 0.002 6,530.799 ↓ 0.0 0 1

Hash Left Join (cost=164,769.25..504,160.59 rows=2 width=100) (actual time=6,530.793..6,530.799 rows=0 loops=1)

  • Hash Cond: (m.id = dlm.id)
  • Filter: (COALESCE(dlm.is_enabled, true) OR (dls.start_schedule <= dlm.updated_at))
5. 54.706 6,530.797 ↓ 0.0 0 1

Nested Loop (cost=164,768.18..504,159.51 rows=3 width=97) (actual time=6,530.792..6,530.797 rows=0 loops=1)

6. 56.936 6,309.153 ↓ 428.0 83,469 1

Nested Loop (cost=164,767.75..503,863.91 rows=195 width=91) (actual time=65.094..6,309.153 rows=83,469 loops=1)

7. 28.903 6,001.810 ↓ 428.0 83,469 1

Nested Loop (cost=164,767.19..503,533.81 rows=195 width=85) (actual time=65.067..6,001.810 rows=83,469 loops=1)

  • Join Filter: (dls.outcome_id = o.id)
8. 20.302 5,639.031 ↓ 428.0 83,469 1

Nested Loop Left Join (cost=164,766.62..503,180.99 rows=195 width=75) (actual time=65.041..5,639.031 rows=83,469 loops=1)

  • Filter: (((orisk.risk_reached IS NULL) OR (orisk.risk_reached > '-0.8'::numeric)) AND ((orisk.risk_bc IS NULL) OR ((orisk.risk_bc / (dls.limit_total)::numeric) > '-0.8'::numeric)))
  • Rows Removed by Filter: 136
9. 2,501.081 5,367.914 ↓ 143.2 83,605 1

Hash Join (cost=164,766.19..502,247.07 rows=584 width=69) (actual time=65.011..5,367.914 rows=83,605 loops=1)

  • Hash Cond: ((dynamic_limit_schedule.outcome_id = dls.outcome_id) AND (dynamic_limit_schedule.rule_id = dls.rule_id))
10. 2,802.937 2,802.937 ↑ 1.0 12,657,760 1

Seq Scan on dynamic_limit_schedule (cost=0.00..271,023.84 rows=12,658,484 width=43) (actual time=0.008..2,802.937 rows=12,657,760 loops=1)

11. 25.944 63.896 ↑ 6.2 83,605 1

Hash (cost=156,947.41..156,947.41 rows=521,252 width=30) (actual time=63.894..63.896 rows=83,605 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 9,322kB
12. 32.424 37.952 ↑ 6.2 83,605 1

Bitmap Heap Scan on dynamic_limit_schedule dls (cost=4,689.63..156,947.41 rows=521,252 width=30) (actual time=6.869..37.952 rows=83,605 loops=1)

  • Recheck Cond: ((start_schedule <= now()) AND (NOT is_disabled) AND (NOT is_applied))
  • Heap Blocks: exact=8,853
13. 5.528 5.528 ↑ 6.2 84,683 1

Bitmap Index Scan on dynamic_limit_schedule_start_schedule_is_applied_is_disabled_pa (cost=0.00..4,559.31 rows=521,252 width=0) (actual time=5.527..5.528 rows=84,683 loops=1)

  • Index Cond: (start_schedule <= now())
14. 250.815 250.815 ↓ 0.0 0 83,605

Index Scan using outcome_risk_pkey on outcome_risk orisk (cost=0.43..1.58 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=83,605)

  • Index Cond: (outcome_id = dls.outcome_id)
15. 333.876 333.876 ↑ 1.0 1 83,469

Index Scan using outcome_pkey on outcome o (cost=0.57..1.80 rows=1 width=14) (actual time=0.004..0.004 rows=1 loops=83,469)

  • Index Cond: (id = dynamic_limit_schedule.outcome_id)
16. 250.407 250.407 ↑ 1.0 1 83,469

Index Scan using market_pkey on market mk (cost=0.56..1.69 rows=1 width=14) (actual time=0.003..0.003 rows=1 loops=83,469)

  • Index Cond: (id = o.market_id)
17. 166.938 166.938 ↓ 0.0 0 83,469

Index Scan using match_pkey on match m (cost=0.42..1.52 rows=1 width=10) (actual time=0.002..0.002 rows=0 loops=83,469)

  • Index Cond: (id = mk.match_id)
  • Filter: (match_start > now())
  • Rows Removed by Filter: 1
18. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.03..1.03 rows=3 width=19) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Seq Scan on dynamic_limit_match dlm (cost=0.00..1.03 rows=3 width=19) (never executed)