explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mrnZ

Settings
# exclusive inclusive rows x rows loops node
1. 46.154 56,208.228 ↑ 27.1 5,059 1

GroupAggregate (cost=2,934,033,607.09..5,029,682,303.08 rows=137,241 width=489) (actual time=56,160.447..56,208.228 rows=5,059 loops=1)

  • Group Key: ib.id, ibd.id
2. 27.552 56,162.074 ↑ 194,360.4 5,351 1

Sort (cost=2,934,033,607.09..2,936,633,663.25 rows=1,040,022,464 width=1,143) (actual time=56,160.406..56,162.074 rows=5,351 loops=1)

  • Sort Key: ib.id, ibd.id
  • Sort Method: external merge Disk: 3976kB
3. 10.449 56,134.522 ↑ 194,360.4 5,351 1

Nested Loop (cost=3,919.53..183,291,683.93 rows=1,040,022,464 width=1,143) (actual time=29.456..56,134.522 rows=5,351 loops=1)

4. 16.127 989.119 ↑ 166.4 5,622 1

Nested Loop (cost=3,599.24..231,276.54 rows=935,272 width=1,227) (actual time=15.675..989.119 rows=5,622 loops=1)

5. 2.704 31.184 ↓ 1.1 5,606 1

Hash Left Join (cost=3,596.99..4,350.10 rows=5,083 width=1,320) (actual time=15.455..31.184 rows=5,606 loops=1)

  • Hash Cond: (ib.theatre_id = t.id)
6. 4.171 13.395 ↓ 1.1 5,606 1

Hash Left Join (cost=242.69..982.46 rows=5,083 width=1,299) (actual time=0.140..13.395 rows=5,606 loops=1)

  • Hash Cond: (ib.movie_id = m.id)
7. 3.490 9.212 ↓ 1.1 5,606 1

Hash Left Join (cost=238.26..961.73 rows=5,083 width=1,288) (actual time=0.118..9.212 rows=5,606 loops=1)

  • Hash Cond: (ib.id = ibd.individual_brand_id)
8. 5.620 5.620 ↓ 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.620 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
9. 0.019 0.102 ↑ 1.2 22 1

Hash (cost=237.92..237.92 rows=27 width=569) (actual time=0.102..0.102 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
10. 0.011 0.083 ↑ 1.2 22 1

Nested Loop Left Join (cost=4.72..237.92 rows=27 width=569) (actual time=0.033..0.083 rows=22 loops=1)

11. 0.017 0.072 ↑ 1.2 22 1

Hash Left Join (cost=4.43..17.62 rows=27 width=548) (actual time=0.030..0.072 rows=22 loops=1)

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
14. 0.007 0.007 ↓ 1.2 23 1

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

15. 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)
16. 0.007 0.012 ↓ 1.2 23 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
17. 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)

18. 7.295 15.085 ↓ 1.0 34,863 1

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

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

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

20. 645.425 941.808 ↑ 184.0 1 5,606

Hash Right Join (cost=2.25..45.06 rows=184 width=26) (actual time=0.069..0.168 rows=1 loops=5,606)

  • Hash Cond: ((adv.id)::text = adv_id.adv_id)
21. 273.959 273.959 ↓ 1.0 370 5,591

Seq Scan on advertisers adv (cost=0.00..38.67 rows=367 width=26) (actual time=0.001..0.049 rows=370 loops=5,591)

22. 5.606 22.424 ↑ 100.0 1 5,606

Hash (cost=1.00..1.00 rows=100 width=32) (actual time=0.004..0.004 rows=1 loops=5,606)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 16.818 16.818 ↑ 100.0 1 5,606

Function Scan on unnest adv_id (cost=0.00..1.00 rows=100 width=32) (actual time=0.003..0.003 rows=1 loops=5,606)

24. 3,602.730 55,134.954 ↑ 1,112.0 1 5,622

Hash Right Join (cost=320.29..504.90 rows=1,112 width=32) (actual time=2.438..9.807 rows=1 loops=5,622)

  • Hash Cond: ((childcategory.id)::text = cat_id.cat_id)
25. 47,509.251 51,520.980 ↓ 1.0 2,226 5,090

Hash Left Join (cost=318.03..477.63 rows=2,223 width=48) (actual time=0.009..10.122 rows=2,226 loops=5,090)

  • Hash Cond: (parentcategory.parent_id = grandparentcategory.id)
26. 2,722.173 4,010.920 ↓ 1.0 2,226 5,090

Hash Left Join (cost=159.02..296.09 rows=2,223 width=160) (actual time=0.001..0.788 rows=2,226 loops=5,090)

  • Hash Cond: (childcategory.parent_id = parentcategory.id)
27. 1,287.770 1,287.770 ↓ 1.0 2,226 5,090

Seq Scan on categories childcategory (cost=0.00..131.23 rows=2,223 width=88) (actual time=0.001..0.253 rows=2,226 loops=5,090)

28. 0.517 0.977 ↓ 1.0 2,226 1

Hash (cost=131.23..131.23 rows=2,223 width=88) (actual time=0.977..0.977 rows=2,226 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 279kB
29. 0.460 0.460 ↓ 1.0 2,226 1

Seq Scan on categories parentcategory (cost=0.00..131.23 rows=2,223 width=88) (actual time=0.001..0.460 rows=2,226 loops=1)

30. 0.465 0.809 ↓ 1.0 2,226 1

Hash (cost=131.23..131.23 rows=2,223 width=72) (actual time=0.809..0.809 rows=2,226 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 259kB
31. 0.344 0.344 ↓ 1.0 2,226 1

Seq Scan on categories grandparentcategory (cost=0.00..131.23 rows=2,223 width=72) (actual time=0.001..0.344 rows=2,226 loops=1)

32. 5.622 11.244 ↑ 100.0 1 5,622

Hash (cost=1.00..1.00 rows=100 width=32) (actual time=0.002..0.002 rows=1 loops=5,622)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
33. 5.622 5.622 ↑ 100.0 1 5,622

Function Scan on unnest cat_id (cost=0.00..1.00 rows=100 width=32) (actual time=0.001..0.001 rows=1 loops=5,622)

Planning time : 3.217 ms
Execution time : 56,210.101 ms