explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZejY

Settings
# exclusive inclusive rows x rows loops node
1. 3.385 70,717.458 ↑ 1.0 1 1

Aggregate (cost=17,497,888.06..17,497,888.07 rows=1 width=8) (actual time=70,717.458..70,717.458 rows=1 loops=1)

  • JIT:
  • Functions: 39
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 3.627 ms, Inlining 7.296 ms, Optimization 172.406 ms, Emission 98.201 ms, Total 281.529 ms
2. 8.244 70,714.073 ↑ 1.9 38,015 1

Nested Loop (cost=0.71..17,497,712.00 rows=70,426 width=0) (actual time=14,640.089..70,714.073 rows=38,015 loops=1)

  • Join Filter: (campaigns.advertiser_id = advertiser.id)
3. 17.009 70,705.829 ↑ 2.8 38,015 1

Nested Loop (cost=0.71..17,494,893.89 rows=105,640 width=4) (actual time=14,640.080..70,705.829 rows=38,015 loops=1)

  • Join Filter: (orders.campaign_id = campaigns.id)
  • Rows Removed by Join Filter: 76,030
4. 4.796 70,688.820 ↑ 2.8 38,015 1

Nested Loop (cost=0.71..17,488,026.22 rows=105,640 width=4) (actual time=14,640.066..70,688.820 rows=38,015 loops=1)

5. 278.452 278.452 ↑ 1.0 12 1

Index Scan using projects_id_idx on projects (cost=0.15..1,122.41 rows=12 width=4) (actual time=278.329..278.452 rows=12 loops=1)

  • Filter: (publisher_id = 1,025)
  • Rows Removed by Filter: 348
6. 66,889.464 70,405.572 ↑ 2.8 3,168 12

Index Scan using orders_project_id_idx on orders (cost=0.56..1,457,153.95 rows=8,803 width=12) (actual time=1,945.403..5,867.131 rows=3,168 loops=12)

  • Index Cond: (project_id = projects.id)
  • Filter: ((status >= 0) AND ((SubPlan 1) >= '2020-07-01 00:00:00+02'::timestamp with time zone) AND ((SubPlan 2) <= '2020-07-10 23:59:59+02'::timestamp with time zone))
  • Rows Removed by Filter: 287,191
7.          

SubPlan (for Index Scan)

8. 3,478.093 3,478.093 ↑ 1.0 1 3,478,093

Index Scan using events_pkey on events (cost=0.14..8.16 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=3,478,093)

  • Index Cond: (id = orders.salary_id)
9. 38.015 38.015 ↑ 1.0 1 38,015

Index Scan using events_pkey on events events_1 (cost=0.14..8.16 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=38,015)

  • Index Cond: (id = orders.salary_id)
10. 0.000 0.000 ↑ 1.7 3 38,015

Materialize (cost=0.00..1.07 rows=5 width=8) (actual time=0.000..0.000 rows=3 loops=38,015)

11. 0.008 0.008 ↑ 1.7 3 1

Seq Scan on campaigns (cost=0.00..1.05 rows=5 width=8) (actual time=0.008..0.008 rows=3 loops=1)

12. 0.000 0.000 ↑ 2.0 1 38,015

Materialize (cost=0.00..1.05 rows=2 width=4) (actual time=0.000..0.000 rows=1 loops=38,015)

13. 0.006 0.006 ↑ 2.0 1 1

Seq Scan on advertiser (cost=0.00..1.04 rows=2 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Filter: (network_id = ANY ('{1,-1}'::integer[]))
Planning time : 0.749 ms
Execution time : 70,721.189 ms