explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8vpY

Settings
# exclusive inclusive rows x rows loops node
1. 3,858.733 286,099.444 ↑ 627,150.3 14 1

Merge Join (cost=12,596,637.28..14,791,663.28 rows=8,780,104 width=1,620) (actual time=278,667.345..286,099.444 rows=14 loops=1)

  • Merge Cond: ((first_value(x.id) OVER (?)) = s_cf.id)
2. 0.091 14.508 ↑ 627,150.3 14 1

Sort (cost=9,079,499.85..9,101,450.11 rows=8,780,104 width=1,341) (actual time=14.497..14.508 rows=14 loops=1)

  • Sort Key: (first_value(x.id) OVER (?))
  • Sort Method: quicksort Memory: 39kB
3. 0.079 14.417 ↑ 627,150.3 14 1

WindowAgg (cost=5,948,784.32..6,146,336.66 rows=8,780,104 width=1,341) (actual time=14.349..14.417 rows=14 loops=1)

4. 0.076 14.338 ↑ 627,150.3 14 1

Sort (cost=5,948,784.32..5,970,734.58 rows=8,780,104 width=1,325) (actual time=14.333..14.338 rows=14 loops=1)

  • Sort Key: x.person_id, x.channel_partition, x.first_seen
  • Sort Method: quicksort Memory: 39kB
5. 0.022 14.262 ↑ 627,150.3 14 1

Subquery Scan on x (cost=2,817,553.52..3,124,857.16 rows=8,780,104 width=1,325) (actual time=14.161..14.262 rows=14 loops=1)

6. 0.110 14.240 ↑ 627,150.3 14 1

WindowAgg (cost=2,817,553.52..3,037,056.12 rows=8,780,104 width=1,325) (actual time=14.159..14.240 rows=14 loops=1)

7. 0.095 14.130 ↑ 627,150.3 14 1

Sort (cost=2,817,553.52..2,839,503.78 rows=8,780,104 width=1,309) (actual time=14.122..14.130 rows=14 loops=1)

  • Sort Key: s.person_id, s.first_seen
  • Sort Method: quicksort Memory: 39kB
8. 0.062 14.035 ↑ 627,150.3 14 1

Nested Loop (cost=8.69..15,062.62 rows=8,780,104 width=1,309) (actual time=1.828..14.035 rows=14 loops=1)

9. 0.040 0.491 ↑ 22.2 9 1

HashAggregate (cost=8.12..10.12 rows=200 width=16) (actual time=0.481..0.491 rows=9 loops=1)

  • Group Key: a.person_id
10. 0.451 0.451 ↑ 25.0 10 1

Seq Scan on dirty_alias_test a (cost=0.00..7.50 rows=250 width=16) (actual time=0.449..0.451 rows=10 loops=1)

11. 13.482 13.482 ↑ 36.0 2 9

Index Scan using session_clone2dd_cfa9_40bb_89ed_25482f835838__pid_ts on session_clone2dd_cfa9_40bb_89ed_25482f835838 s (cost=0.56..74.54 rows=72 width=1,309) (actual time=1.294..1.498 rows=2 loops=9)

  • Index Cond: (person_id = a.person_id)
12. 40,821.704 282,226.203 ↑ 1.1 16,206,238 1

Sort (cost=3,517,137.43..3,561,037.95 rows=17,560,208 width=95) (actual time=277,632.117..282,226.203 rows=16,206,238 loops=1)

  • Sort Key: s_cf.id
  • Sort Method: external merge Disk: 671648kB
13. 241,404.499 241,404.499 ↑ 1.0 17,555,815 1

Seq Scan on session_clone2dd_cfa9_40bb_89ed_25482f835838 s_cf (cost=0.00..1,082,597.08 rows=17,560,208 width=95) (actual time=0.006..241,404.499 rows=17,555,815 loops=1)