explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mQgl

Settings
# exclusive inclusive rows x rows loops node
1. 33,173.526 50,607.586 ↑ 12.8 1,985,129 1

GroupAggregate (cost=885,236,908.07..971,762,862.87 rows=25,480,000 width=180) (actual time=16,033.430..50,607.586 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. 8,247.770 17,434.060 ↑ 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=16,033.371..17,434.060 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. 838.613 9,186.290 ↑ 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,649.470..9,186.290 rows=2,161,833 loops=1)

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

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

  • Sort Key: mr.gid_movie
  • Sort Method: quicksort Memory: 1061kB
5. 1.698 1.698 ↓ 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.019..1.698 rows=8,660 loops=1)

6. 783.313 8,341.978 ↑ 31.8 2,161,833 1

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

7. 1,054.074 7,558.665 ↑ 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,644.397..7,558.665 rows=2,161,833 loops=1)

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

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

  • Sort Key: social_offset_fs.gid_entity
  • Sort Method: external merge Disk: 375560kB
9. 783.039 783.039 ↑ 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.013..783.039 rows=2,161,833 loops=1)

10. 9.970 10.438 ↓ 29.1 185,276 1

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

  • Sort Key: sr.gid
  • Sort Method: quicksort Memory: 1098kB
11. 0.468 0.468 ↑ 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.009..0.468 rows=3,229 loops=1)

Planning time : 0.340 ms
Execution time : 50,778.719 ms