explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8xWJ

Settings
# exclusive inclusive rows x rows loops node
1. 74.762 1,879.014 ↓ 5.0 45,272 1

HashAggregate (cost=198,269.33..198,383.04 rows=9,097 width=40) (actual time=1,864.880..1,879.014 rows=45,272 loops=1)

  • Output: uu.url_id, sum(((common.count_url)::numeric * url.weight))
  • Group Key: uu.url_id
2. 51.500 1,804.252 ↓ 3.7 106,705 1

Nested Loop (cost=154,612.93..197,977.48 rows=29,185 width=21) (actual time=1,298.917..1,804.252 rows=106,705 loops=1)

  • Output: uu.url_id, common.count_url, url.weight
  • Inner Unique: true
3. 166.705 1,539.342 ↓ 3.7 106,705 1

Hash Join (cost=154,612.51..178,282.14 rows=29,185 width=16) (actual time=1,298.902..1,539.342 rows=106,705 loops=1)

  • Output: common.count_url, uu.url_id
  • Hash Cond: (uu.session_id = s.id)
4. 74.106 74.106 ↑ 1.0 651,257 1

Seq Scan on public.session_url uu (cost=0.00..13,218.57 rows=651,257 width=16) (actual time=0.036..74.106 rows=651,257 loops=1)

  • Output: uu.url_id, uu.session_id
5. 45.169 1,298.531 ↑ 1.3 211,902 1

Hash (cost=149,784.05..149,784.05 rows=277,717 width=16) (actual time=1,298.531..1,298.531 rows=211,902 loops=1)

  • Output: common.count_url, s.id
  • Buckets: 131072 Batches: 8 Memory Usage: 2281kB
6. 796.044 1,253.362 ↑ 1.3 211,902 1

Hash Join (cost=472.83..149,784.05 rows=277,717 width=16) (actual time=14.284..1,253.362 rows=211,902 loops=1)

  • Output: common.count_url, s.id
  • Hash Cond: (s.user_id = common.uid)
7. 443.121 443.121 ↑ 1.0 6,195,735 1

Seq Scan on public.session s (cost=0.00..123,294.67 rows=6,197,167 width=24) (actual time=0.011..443.121 rows=6,195,735 loops=1)

  • Output: s.id, s.user_id, s.fingerprint_id, s.time_start, s.time_end, s.ip_address
8. 8.249 14.197 ↑ 1.0 16,348 1

Hash (cost=268.48..268.48 rows=16,348 width=24) (actual time=14.197..14.197 rows=16,348 loops=1)

  • Output: common.count_url, common.uid
  • Buckets: 16384 Batches: 1 Memory Usage: 1023kB
9. 5.948 5.948 ↑ 1.0 16,348 1

Seq Scan on pg_temp_3.temp_common common (cost=0.00..268.48 rows=16,348 width=24) (actual time=0.013..5.948 rows=16,348 loops=1)

  • Output: common.count_url, common.uid
10. 213.410 213.410 ↑ 1.0 1 106,705

Index Scan using ix_url_id on public.url (cost=0.42..0.67 rows=1 width=13) (actual time=0.002..0.002 rows=1 loops=106,705)

  • Output: url.id, url.created, url.url, url.og, url.weight, url.visits, url.updated, url.first_updated, url.recommend
  • Index Cond: (url.id = uu.url_id)
Planning time : 4.100 ms
Execution time : 1,880.403 ms