explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zV1

Settings
# exclusive inclusive rows x rows loops node
1. 1.576 400.180 ↑ 16.5 3,541 1

Sort (cost=60,229.84..60,376.24 rows=58,561 width=63) (actual time=399.919..400.180 rows=3,541 loops=1)

  • Sort Key: p.task_id DESC, p.created_at
  • Sort Method: quicksort Memory: 594kB
2. 0.284 398.604 ↑ 16.5 3,541 1

Append (cost=16,297.50..53,387.50 rows=58,561 width=63) (actual time=104.886..398.604 rows=3,541 loops=1)

3. 2.936 111.572 ↑ 4.8 1,866 1

Unique (cost=16,297.50..16,508.16 rows=8,882 width=83) (actual time=104.885..111.572 rows=1,866 loops=1)

4. 29.431 108.636 ↓ 1.1 30,615 1

Sort (cost=16,297.50..16,367.72 rows=28,089 width=83) (actual time=104.874..108.636 rows=30,615 loops=1)

  • Sort Key: p.task_id, p.promoter_id
  • Sort Method: external sort Disk: 2176kB
5. 10.095 79.205 ↓ 1.1 30,615 1

Hash Left Join (cost=7,517.09..14,222.04 rows=28,089 width=83) (actual time=46.131..79.205 rows=30,615 loops=1)

  • Hash Cond: (p.promoter_id = u.id)
6. 24.116 24.116 ↓ 1.1 30,615 1

Seq Scan on promotions p (cost=0.00..5,822.01 rows=28,089 width=16) (actual time=0.649..24.116 rows=30,615 loops=1)

  • Filter: (promoter_id IS NOT NULL)
  • Rows Removed by Filter: 59367
7. 16.210 44.994 ↑ 1.0 53,026 1

Hash (cost=6,439.26..6,439.26 rows=53,026 width=39) (actual time=44.994..44.994 rows=53,026 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 2441kB
8. 28.784 28.784 ↑ 1.0 53,026 1

Seq Scan on users u (cost=0.00..6,439.26 rows=53,026 width=39) (actual time=0.008..28.784 rows=53,026 loops=1)

9. 3.593 286.748 ↑ 29.7 1,675 1

Unique (cost=35,796.93..36,293.72 rows=49,679 width=59) (actual time=279.675..286.748 rows=1,675 loops=1)

10. 35.831 283.155 ↑ 1.7 29,236 1

Sort (cost=35,796.93..35,921.13 rows=49,679 width=59) (actual time=279.674..283.155 rows=29,236 loops=1)

  • Sort Key: p_1.task_id, p_1.promoter_id, t."to
  • Sort Method: external sort Disk: 2048kB
11. 32.187 247.324 ↑ 1.7 29,236 1

Hash Join (cost=19,130.24..30,052.88 rows=49,679 width=59) (actual time=183.837..247.324 rows=29,236 loops=1)

  • Hash Cond: (p_1.task_id = t.task_id)
12. 9.075 85.384 ↓ 1.1 30,615 1

Hash Left Join (cost=7,517.09..14,166.04 rows=28,089 width=43) (actual time=53.273..85.384 rows=30,615 loops=1)

  • Hash Cond: (p_1.promoter_id = u_1.id)
13. 23.591 23.591 ↓ 1.1 30,615 1

Seq Scan on promotions p_1 (cost=0.00..5,822.01 rows=28,089 width=8) (actual time=0.115..23.591 rows=30,615 loops=1)

  • Filter: (promoter_id IS NOT NULL)
  • Rows Removed by Filter: 59367
14. 17.194 52.718 ↑ 1.0 53,026 1

Hash (cost=6,439.26..6,439.26 rows=53,026 width=39) (actual time=52.718..52.718 rows=53,026 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 2441kB
15. 35.524 35.524 ↑ 1.0 53,026 1

Seq Scan on users u_1 (cost=0.00..6,439.26 rows=53,026 width=39) (actual time=0.008..35.524 rows=53,026 loops=1)

16. 32.732 129.753 ↑ 1.0 134,281 1

Hash (cost=9,138.27..9,138.27 rows=134,791 width=20) (actual time=129.753..129.753 rows=134,281 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 2420kB
17. 97.021 97.021 ↑ 1.0 134,281 1

Seq Scan on task_state_transitions t (cost=0.00..9,138.27 rows=134,791 width=20) (actual time=0.020..97.021 rows=134,281 loops=1)

  • Filter: (("to")::text = ANY ('{estimated,paid,completed}'::text[]))
  • Rows Removed by Filter: 277981