explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lD59

Settings
# exclusive inclusive rows x rows loops node
1. 4.735 62,251.329 ↑ 1.0 1 1

Aggregate (cost=21,370,749.18..21,370,749.19 rows=1 width=8) (actual time=62,251.329..62,251.329 rows=1 loops=1)

  • JIT:
  • Functions: 60
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 6.092 ms, Inlining 13.670 ms, Optimization 355.681 ms, Emission 198.062 ms, Total 573.505 ms
2. 11.461 62,246.594 ↓ 1.1 38,015 1

Nested Loop (cost=5.38..21,370,660.71 rows=35,389 width=0) (actual time=1,633.384..62,246.594 rows=38,015 loops=1)

  • Join Filter: (campaigns.advertiser_id = advertiser.id)
3. 21.685 62,235.133 ↑ 1.4 38,015 1

Nested Loop (cost=5.38..21,369,244.10 rows=53,084 width=4) (actual time=1,633.375..62,235.133 rows=38,015 loops=1)

  • Join Filter: (orders.campaign_id = campaigns.id)
  • Rows Removed by Join Filter: 76,030
4. 6.728 62,213.448 ↑ 1.4 38,015 1

Nested Loop (cost=5.38..21,365,792.59 rows=53,084 width=4) (actual time=1,633.360..62,213.448 rows=38,015 loops=1)

5. 549.496 549.496 ↑ 1.0 12 1

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

  • Filter: (publisher_id = 1,025)
  • Rows Removed by Filter: 348
6. 58,122.358 61,657.224 ↑ 1.4 3,168 12

Index Scan using orders_project_id_idx on orders (cost=5.23..1,780,344.94 rows=4,424 width=12) (actual time=2,134.345..5,138.102 rows=3,168 loops=12)

  • Index Cond: (project_id = projects.id)
  • Filter: ((status >= 0) AND (visibility = 1) AND ((hashed SubPlan 3) OR ((SubPlan 4) IS NULL)) 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. 18.758 18.758 ↓ 2.5 5 1

Seq Scan on campaign_settings (cost=0.00..4.66 rows=2 width=4) (actual time=18.738..18.758 rows=5 loops=1)

  • Filter: (((key)::text = 'display_type'::text) AND ((value)::integer < 3))
  • Rows Removed by Filter: 128
9. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..4.00 rows=1 width=4) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on campaign_settings campaign_settings_1 (cost=0.00..4.00 rows=1 width=4) (never executed)

  • Filter: (((key)::text = 'display_type'::text) AND (campaign_id = orders.campaign_id))
11. 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)
12. 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)
13. 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)

14. 0.008 0.008 ↑ 1.7 3 1

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

15. 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)

16. 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.900 ms
Execution time : 62,257.411 ms