explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vEv4

Settings
# exclusive inclusive rows x rows loops node
1. 33,525.659 49,777.048 ↑ 12.8 1,985,129 1

GroupAggregate (cost=885,236,908.07..971,762,862.87 rows=25,480,000 width=180) (actual time=14,819.481..49,777.048 rows=1,985,129 loops=1)

  • Group Key: social_offset_fs.id_user, ((social_offset_fs.gid_entity)::text), (CASE WHEN (sr.gid IS NOT NULL) THEN sr.series_tags ELSE NULL::ltree[] END)
2. 7,646.657 16,251.389 ↑ 1,135.1 2,161,833 1

Sort (cost=885,236,908.07..891,371,833.41 rows=2,453,970,137 width=338) (actual time=14,819.432..16,251.389 rows=2,161,833 loops=1)

  • Sort Key: social_offset_fs.id_user, ((social_offset_fs.gid_entity)::text), (CASE WHEN (sr.gid IS NOT NULL) THEN sr.series_tags ELSE NULL::ltree[] END)
  • Sort Method: external merge Disk: 447640kB
3. 768.716 8,604.732 ↑ 1,135.1 2,161,833 1

Merge Right Join (cost=415,434.68..50,538,497.97 rows=2,453,970,137 width=338) (actual time=5,298.673..8,604.732 rows=2,161,833 loops=1)

  • Merge Cond: ((mr.gid_movie)::ltree = (social_offset_fs.gid_entity)::ltree)
4. 3.398 4.894 ↓ 1.2 8,660 1

Sort (cost=608.45..626.27 rows=7,128 width=64) (actual time=4.345..4.894 rows=8,660 loops=1)

  • Sort Key: mr.gid_movie
  • Sort Method: quicksort Memory: 1061kB
5. 1.496 1.496 ↓ 1.2 8,660 1

Seq Scan on movie_releases_fs mr (cost=0.00..152.28 rows=7,128 width=64) (actual time=0.027..1.496 rows=8,660 loops=1)

6. 779.660 7,831.122 ↑ 31.8 2,161,833 1

Materialize (cost=414,826.23..1,630,587.07 rows=68,854,381 width=274) (actual time=5,294.322..7,831.122 rows=2,161,833 loops=1)

7. 974.976 7,051.462 ↑ 31.8 2,161,833 1

Merge Left Join (cost=414,826.23..1,458,451.11 rows=68,854,381 width=274) (actual time=5,294.319..7,051.462 rows=2,161,833 loops=1)

  • Merge Cond: ((social_offset_fs.gid_entity)::ltree = (sr.gid)::ltree)
8. 5,304.143 6,067.301 ↑ 1.0 2,161,833 1

Sort (cost=414,262.04..419,666.62 rows=2,161,833 width=178) (actual time=5,293.208..6,067.301 rows=2,161,833 loops=1)

  • Sort Key: social_offset_fs.gid_entity
  • Sort Method: external merge Disk: 375560kB
9. 763.158 763.158 ↑ 1.0 2,161,833 1

Seq Scan on social_offset_fs (cost=0.00..74,269.33 rows=2,161,833 width=178) (actual time=0.011..763.158 rows=2,161,833 loops=1)

10. 8.724 9.185 ↓ 29.1 185,276 1

Sort (cost=564.19..580.12 rows=6,370 width=96) (actual time=1.107..9.185 rows=185,276 loops=1)

  • Sort Key: sr.gid
  • Sort Method: quicksort Memory: 1098kB
11. 0.461 0.461 ↑ 2.0 3,229 1

Seq Scan on series_releases_fs sr (cost=0.00..161.70 rows=6,370 width=96) (actual time=0.010..0.461 rows=3,229 loops=1)

Planning time : 0.348 ms
Execution time : 49,955.159 ms