explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RTu9

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 4,729.431 ↑ 30.7 130 1

Finalize GroupAggregate (cost=509,142.60..510,223.29 rows=3,990 width=44) (actual time=4,728.951..4,729.431 rows=130 loops=1)

  • Group Key: advertiser.network_id, projects.publisher_id, orders.status
2. 8.981 4,734.816 ↑ 22.0 363 1

Gather Merge (cost=509,142.60..510,073.67 rows=7,980 width=44) (actual time=4,728.940..4,734.816 rows=363 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.094 4,725.835 ↑ 33.0 121 3 / 3

Sort (cost=508,142.58..508,152.55 rows=3,990 width=44) (actual time=4,725.825..4,725.835 rows=121 loops=3)

  • Sort Key: advertiser.network_id, projects.publisher_id, orders.status
  • Sort Method: quicksort Memory: 42kB
  • Worker 0: Sort Method: quicksort Memory: 41kB
  • Worker 1: Sort Method: quicksort Memory: 41kB
4. 1,443.682 4,725.741 ↑ 33.0 121 3 / 3

Partial HashAggregate (cost=507,854.06..507,903.93 rows=3,990 width=44) (actual time=4,725.630..4,725.741 rows=121 loops=3)

  • Group Key: advertiser.network_id, projects.publisher_id, orders.status
5. 597.050 3,282.059 ↑ 1.3 1,704,073 3 / 3

Hash Join (cost=5,125.81..475,759.19 rows=2,139,658 width=20) (actual time=28.885..3,282.059 rows=1,704,073 loops=3)

  • Hash Cond: (campaigns.advertiser_id = advertiser.id)
6. 606.685 2,684.979 ↑ 1.3 1,704,073 3 / 3

Hash Join (cost=5,124.38..468,888.33 rows=2,139,658 width=20) (actual time=28.826..2,684.979 rows=1,704,073 loops=3)

  • Hash Cond: (orders.campaign_id = campaigns.id)
7. 766.619 2,078.048 ↑ 1.3 1,704,073 3 / 3

Parallel Hash Join (cost=5,080.55..463,087.88 rows=2,139,658 width=20) (actual time=28.565..2,078.048 rows=1,704,073 loops=3)

  • Hash Cond: (orders.project_id = projects.id)
8. 1,283.482 1,283.482 ↑ 1.3 1,704,075 3 / 3

Parallel Seq Scan on orders (cost=0.00..452,390.57 rows=2,139,658 width=20) (actual time=0.037..1,283.482 rows=1,704,075 loops=3)

  • Filter: (status = ANY ('{0,1,2,3}'::integer[]))
  • Rows Removed by Filter: 1,127
9. 13.371 27.947 ↑ 1.3 51,966 3 / 3

Parallel Hash (cost=4,268.58..4,268.58 rows=64,958 width=8) (actual time=27.947..27.947 rows=51,966 loops=3)

  • Buckets: 262,144 Batches: 1 Memory Usage: 8,192kB
10. 14.576 14.576 ↑ 1.3 51,966 3 / 3

Parallel Seq Scan on projects (cost=0.00..4,268.58 rows=64,958 width=8) (actual time=0.007..14.576 rows=51,966 loops=3)

11. 0.033 0.246 ↑ 1.0 170 3 / 3

Hash (cost=41.70..41.70 rows=170 width=8) (actual time=0.246..0.246 rows=170 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
12. 0.213 0.213 ↑ 1.0 170 3 / 3

Seq Scan on campaigns (cost=0.00..41.70 rows=170 width=8) (actual time=0.009..0.213 rows=170 loops=3)

13. 0.009 0.030 ↑ 1.0 19 3 / 3

Hash (cost=1.19..1.19 rows=19 width=8) (actual time=0.029..0.030 rows=19 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
14. 0.021 0.021 ↑ 1.0 19 3 / 3

Seq Scan on advertiser (cost=0.00..1.19 rows=19 width=8) (actual time=0.017..0.021 rows=19 loops=3)

Planning time : 2.334 ms
Execution time : 4,735.481 ms