explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IeIg

Settings
# exclusive inclusive rows x rows loops node
1. 39,351.576 198,731.724 ↓ 2.0 47,102 1

GroupAggregate (cost=20,975,114.97..21,866,224.32 rows=24,113 width=45) (actual time=104,618.974..198,731.724 rows=47,102 loops=1)

  • Group Key: social_movie.gid
2. 115,427.453 159,380.148 ↓ 1.5 176,890,484 1

Sort (cost=20,975,114.97..21,272,071.04 rows=118,782,430 width=45) (actual time=104,618.436..159,380.148 rows=176,890,484 loops=1)

  • Sort Key: social_movie.gid
  • Sort Method: external merge Disk: 10039832kB
3. 27,065.991 43,952.695 ↓ 1.5 176,890,484 1

Merge Join (cost=1,021,418.71..2,903,992.83 rows=118,782,430 width=45) (actual time=3,540.365..43,952.695 rows=176,890,484 loops=1)

  • Merge Cond: (mr.id_movie = social_movie.id)
4. 53.812 2,501.427 ↑ 1.0 354,363 1

Merge Left Join (cost=1.00..83,201.93 rows=358,674 width=12) (actual time=0.092..2,501.427 rows=354,363 loops=1)

  • Merge Cond: (mr.id_movie = s.id_movie)
5. 147.578 2,095.573 ↑ 1.0 354,363 1

Merge Left Join (cost=0.72..82,068.37 rows=358,674 width=12) (actual time=0.062..2,095.573 rows=354,363 loops=1)

  • Merge Cond: (mr.id_movie = ri.id)
6. 1,309.766 1,309.766 ↑ 1.0 351,895 1

Index Scan using movie_has_release_id_movie_idx on movie_has_release mr (cost=0.43..76,982.26 rows=358,674 width=12) (actual time=0.008..1,309.766 rows=351,895 loops=1)

  • Filter: active
  • Rows Removed by Filter: 945572
7. 21.192 638.229 ↓ 7.4 244,831 1

Materialize (cost=0.29..863.62 rows=33,196 width=8) (actual time=0.051..638.229 rows=244,831 loops=1)

8. 617.037 617.037 ↑ 1.0 33,196 1

Index Only Scan using release_in_future_ac_idx on release_in_future_ac ri (cost=0.29..780.63 rows=33,196 width=8) (actual time=0.049..617.037 rows=33,196 loops=1)

  • Heap Fetches: 33196
9. 2.151 352.042 ↓ 12.1 21,596 1

Materialize (cost=0.28..58.26 rows=1,782 width=8) (actual time=0.029..352.042 rows=21,596 loops=1)

10. 349.891 349.891 ↑ 1.0 1,782 1

Index Only Scan using showtimes_ac_idx on showtimes_ac s (cost=0.28..53.81 rows=1,782 width=8) (actual time=0.027..349.891 rows=1,782 loops=1)

  • Heap Fetches: 1782
11. 9,294.897 14,385.277 ↓ 26.3 176,944,035 1

Materialize (cost=1,021,402.89..1,055,059.42 rows=6,731,306 width=45) (actual time=3,540.270..14,385.277 rows=176,944,035 loops=1)

12. 3,918.097 5,090.380 ↑ 1.0 6,731,306 1

Sort (cost=1,021,402.89..1,038,231.15 rows=6,731,306 width=45) (actual time=3,540.268..5,090.380 rows=6,731,306 loops=1)

  • Sort Key: social_movie.id
  • Sort Method: external merge Disk: 382048kB
13. 1,172.283 1,172.283 ↑ 1.0 6,731,306 1

Seq Scan on social_movie_ac social_movie (cost=0.00..136,708.06 rows=6,731,306 width=45) (actual time=0.014..1,172.283 rows=6,731,306 loops=1)

Planning time : 43.129 ms
Execution time : 200,248.821 ms