explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4tgJ

Settings
# exclusive inclusive rows x rows loops node
1. 15.419 7,880.539 ↓ 1.1 5,606 1

Nested Loop (cost=3,596.99..1,399,563.44 rows=5,083 width=473) (actual time=16.958..7,880.539 rows=5,606 loops=1)

2. 7.977 44.750 ↓ 1.1 5,606 1

Nested Loop (cost=3,596.99..4,451.76 rows=5,083 width=1,217) (actual time=15.500..44.750 rows=5,606 loops=1)

3. 2.934 31.167 ↓ 1.1 5,606 1

Hash Left Join (cost=3,596.99..4,350.10 rows=5,083 width=1,304) (actual time=15.492..31.167 rows=5,606 loops=1)

  • Hash Cond: (ib.theatre_id = t.id)
4. 3.697 13.132 ↓ 1.1 5,606 1

Hash Left Join (cost=242.69..982.46 rows=5,083 width=1,283) (actual time=0.160..13.132 rows=5,606 loops=1)

  • Hash Cond: (ib.movie_id = m.id)
5. 3.550 9.422 ↓ 1.1 5,606 1

Hash Left Join (cost=238.26..961.73 rows=5,083 width=1,272) (actual time=0.136..9.422 rows=5,606 loops=1)

  • Hash Cond: (ib.id = ibd.individual_brand_id)
6. 5.771 5.771 ↓ 1.1 5,606 1

Seq Scan on individual_brands ib (cost=0.00..704.16 rows=5,083 width=735) (actual time=0.004..5.771 rows=5,606 loops=1)

  • Filter: ((status <> 'Pending'::text) OR (created_by_company_id = '224629d9-701d-48f4-9b75-051c1ca4a382'::uuid))
  • Rows Removed by Filter: 5
7. 0.017 0.101 ↑ 1.2 22 1

Hash (cost=237.92..237.92 rows=27 width=553) (actual time=0.101..0.101 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
8. 0.011 0.084 ↑ 1.2 22 1

Nested Loop Left Join (cost=4.72..237.92 rows=27 width=553) (actual time=0.032..0.084 rows=22 loops=1)

9. 0.014 0.073 ↑ 1.2 22 1

Hash Left Join (cost=4.43..17.62 rows=27 width=532) (actual time=0.029..0.073 rows=22 loops=1)

  • Hash Cond: (ibd.movie_id = md.id)
10. 0.042 0.042 ↑ 1.2 22 1

Seq Scan on individual_brand_drafts ibd (cost=0.00..13.11 rows=27 width=521) (actual time=0.003..0.042 rows=22 loops=1)

  • Filter: ((status = 'Pending'::text) AND (updated_by_company_id = '224629d9-701d-48f4-9b75-051c1ca4a382'::uuid))
  • Rows Removed by Filter: 53
11. 0.008 0.017 ↓ 1.2 23 1

Hash (cost=4.19..4.19 rows=19 width=27) (actual time=0.016..0.017 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.009 0.009 ↓ 1.2 23 1

Seq Scan on movies md (cost=0.00..4.19 rows=19 width=27) (actual time=0.003..0.009 rows=23 loops=1)

13. 0.000 0.000 ↓ 0.0 0 22

Index Scan using theatres_pkey on theatres td (cost=0.29..8.16 rows=1 width=37) (actual time=0.000..0.000 rows=0 loops=22)

  • Index Cond: (ibd.theatre_id = id)
14. 0.008 0.013 ↓ 1.2 23 1

Hash (cost=4.19..4.19 rows=19 width=27) (actual time=0.013..0.013 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
15. 0.005 0.005 ↓ 1.2 23 1

Seq Scan on movies m (cost=0.00..4.19 rows=19 width=27) (actual time=0.001..0.005 rows=23 loops=1)

16. 7.256 15.101 ↓ 1.0 34,863 1

Hash (cost=2,918.58..2,918.58 rows=34,858 width=37) (actual time=15.101..15.101 rows=34,863 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2862kB
17. 7.845 7.845 ↓ 1.0 34,863 1

Seq Scan on theatres t (cost=0.00..2,918.58 rows=34,858 width=37) (actual time=0.002..7.845 rows=34,863 loops=1)

18. 5.606 5.606 ↑ 1.0 1 5,606

Function Scan on adv_ids (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=5,606)

19. 5.606 5.606 ↑ 1.0 1 5,606

Function Scan on cat_ids (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=5,606)

20.          

SubPlan (for Nested Loop)

21. 44.848 1,182.866 ↑ 1.0 1 5,606

Aggregate (cost=41.43..41.44 rows=1 width=32) (actual time=0.211..0.211 rows=1 loops=5,606)

22. 1,138.018 1,138.018 ↑ 2.0 1 5,606

Seq Scan on advertisers adv (cost=0.00..41.42 rows=2 width=26) (actual time=0.082..0.203 rows=1 loops=5,606)

  • Filter: (adv_ids.adv_ids @> ARRAY[(id)::text])
  • Rows Removed by Filter: 369
23. 50.454 6,631.898 ↑ 1.0 1 5,606

Aggregate (cost=232.98..232.99 rows=1 width=32) (actual time=1.183..1.183 rows=1 loops=5,606)

24. 5.606 6,581.444 ↑ 11.0 1 5,606

Nested Loop Left Join (cost=0.56..232.87 rows=11 width=216) (actual time=0.393..1.174 rows=1 loops=5,606)

25. 11.212 6,575.838 ↑ 11.0 1 5,606

Nested Loop Left Join (cost=0.28..227.18 rows=11 width=160) (actual time=0.392..1.173 rows=1 loops=5,606)

26. 6,564.626 6,564.626 ↑ 11.0 1 5,606

Seq Scan on categories childcategory (cost=0.00..147.90 rows=11 width=88) (actual time=0.391..1.171 rows=1 loops=5,606)

  • Filter: (cat_ids.cat_ids @> ARRAY[(id)::text])
  • Rows Removed by Filter: 2225
27. 0.000 0.000 ↓ 0.0 0 5,080

Index Scan using categories_pkey on categories parentcategory (cost=0.28..7.21 rows=1 width=88) (actual time=0.000..0.000 rows=0 loops=5,080)

  • Index Cond: (childcategory.parent_id = id)
28. 0.000 0.000 ↓ 0.0 0 5,080

Index Scan using categories_pkey on categories grandparentcategory (cost=0.28..0.52 rows=1 width=72) (actual time=0.000..0.000 rows=0 loops=5,080)

  • Index Cond: (parentcategory.parent_id = id)
Planning time : 3.202 ms
Execution time : 7,882.053 ms