explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hWBf

Settings
# exclusive inclusive rows x rows loops node
1. 4.237 42,814.276 ↑ 1.0 1 1

Aggregate (cost=889,691.44..889,691.45 rows=1 width=8) (actual time=42,814.276..42,814.276 rows=1 loops=1)

  • JIT:
  • Functions: 38
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 2.842 ms, Inlining 9.225 ms, Optimization 150.058 ms, Emission 100.629 ms, Total 262.754 ms
2. 9.019 42,810.039 ↓ 9.8 38,015 1

Hash Join (cost=8,268.14..889,681.70 rows=3,896 width=0) (actual time=394.378..42,810.039 rows=38,015 loops=1)

  • Hash Cond: (orders.campaign_id = campaigns.id)
3. 99.457 42,540.547 ↓ 6.5 38,015 1

Hash Join (cost=8,265.95..889,622.54 rows=5,844 width=4) (actual time=133.898..42,540.547 rows=38,015 loops=1)

  • Hash Cond: (orders.project_id = projects.id)
4. 91.675 42,441.070 ↓ 4.5 971,129 1

Nested Loop (cost=8,219.19..888,997.66 rows=218,173 width=8) (actual time=133.870..42,441.070 rows=971,129 loops=1)

5. 0.047 0.047 ↓ 4.0 4 1

Seq Scan on events (cost=0.00..16.47 rows=1 width=4) (actual time=0.040..0.047 rows=4 loops=1)

  • Filter: (("timestamp" >= '2020-07-01 00:00:00+02'::timestamp with time zone) AND ("timestamp" <= '2020-07-10 23:59:59+02'::timestamp with time zone))
  • Rows Removed by Filter: 92
6. 40,775.664 42,349.348 ↑ 1.2 242,782 4

Bitmap Heap Scan on orders (cost=8,219.19..886,011.61 rows=296,958 width=16) (actual time=442.054..10,587.337 rows=242,782 loops=4)

  • Recheck Cond: (salary_id = events.id)
  • Filter: (status >= 0)
  • Heap Blocks: exact=288,151
7. 1,573.684 1,573.684 ↓ 3.2 979,437 4

Bitmap Index Scan on orders_salary_id_idx (cost=0.00..8,144.95 rows=302,452 width=0) (actual time=393.421..393.421 rows=979,437 loops=4)

  • Index Cond: (salary_id = events.id)
8. 0.002 0.020 ↑ 1.0 12 1

Hash (cost=46.61..46.61 rows=12 width=4) (actual time=0.020..0.020 rows=12 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.011 0.018 ↑ 1.0 12 1

Bitmap Heap Scan on projects (cost=4.24..46.61 rows=12 width=4) (actual time=0.012..0.018 rows=12 loops=1)

  • Recheck Cond: (publisher_id = 1,025)
  • Heap Blocks: exact=5
10. 0.007 0.007 ↑ 1.0 12 1

Bitmap Index Scan on projects_publisher_id_idx (cost=0.00..4.24 rows=12 width=0) (actual time=0.007..0.007 rows=12 loops=1)

  • Index Cond: (publisher_id = 1,025)
11. 0.001 260.473 ↑ 1.5 2 1

Hash (cost=2.15..2.15 rows=3 width=4) (actual time=260.473..260.473 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
12. 0.006 260.472 ↑ 1.5 2 1

Hash Join (cost=1.06..2.15 rows=3 width=4) (actual time=260.469..260.472 rows=2 loops=1)

  • Hash Cond: (campaigns.advertiser_id = advertiser.id)
13. 0.006 0.006 ↑ 1.0 5 1

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

14. 0.004 260.460 ↑ 2.0 1 1

Hash (cost=1.04..1.04 rows=2 width=4) (actual time=260.460..260.460 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 260.456 260.456 ↑ 2.0 1 1

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

  • Filter: (network_id = ANY ('{1,-1}'::integer[]))
  • Rows Removed by Filter: 2
Planning time : 0.868 ms
Execution time : 42,820.372 ms