explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FYOm

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 3,255.595 ↑ 1.0 5 1

Limit (cost=15.99..16.00 rows=5 width=29) (actual time=3,255.595..3,255.595 rows=5 loops=1)

  • Output: lmvfv1.person_id, (COALESCE(p.nickname, 'Undefined'::text)), (sum(lmvfv1.so_weight)), ((((sum(lmvfv1.so_weight)) / sum((sum(lmvfv1.so_weight))) OVER (?)) * '100'::numeric)), (sum(lmvfv1.do_weight)), ((((sum(lmvfv1.do_weight)) / sum((sum(lmvfv1.do_weight))) OVER (?)) * '100'::numeric)), (sum((lmvfv1.do_weight + lmvfv1.so_weight))), ((((sum((lmvfv1.do_weight + lmvfv1.so_weight))) / sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?)) * '100'::numeric)), (sum((sum(lmvfv1.so_weight))) OVER (?)), (sum((sum(lmvfv1.do_weight))) OVER (?)), (sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?)), (count(*) OVER (?)), (sum((lmvfv1.so_weight + lmvfv1.do_weight)))
  • Buffers: shared hit=1811 read=44903 dirtied=44 written=1019, temp read=9091 written=12050
2. 0.020 3,255.594 ↑ 2.0 5 1

Sort (cost=15.99..16.01 rows=10 width=29) (actual time=3,255.594..3,255.594 rows=5 loops=1)

  • Output: lmvfv1.person_id, (COALESCE(p.nickname, 'Undefined'::text)), (sum(lmvfv1.so_weight)), ((((sum(lmvfv1.so_weight)) / sum((sum(lmvfv1.so_weight))) OVER (?)) * '100'::numeric)), (sum(lmvfv1.do_weight)), ((((sum(lmvfv1.do_weight)) / sum((sum(lmvfv1.do_weight))) OVER (?)) * '100'::numeric)), (sum((lmvfv1.do_weight + lmvfv1.so_weight))), ((((sum((lmvfv1.do_weight + lmvfv1.so_weight))) / sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?)) * '100'::numeric)), (sum((sum(lmvfv1.so_weight))) OVER (?)), (sum((sum(lmvfv1.do_weight))) OVER (?)), (sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?)), (count(*) OVER (?)), (sum((lmvfv1.so_weight + lmvfv1.do_weight)))
  • Sort Key: (sum((lmvfv1.so_weight + lmvfv1.do_weight))) DESC
  • Sort Method: top-N heapsort Memory: 26kB
  • Buffers: shared hit=1811 read=44903 dirtied=44 written=1019, temp read=9091 written=12050
3. 0.081 3,255.574 ↓ 2.4 24 1

WindowAgg (cost=14.82..15.82 rows=10 width=29) (actual time=3,255.532..3,255.574 rows=24 loops=1)

  • Output: lmvfv1.person_id, (COALESCE(p.nickname, 'Undefined'::text)), (sum(lmvfv1.so_weight)), (((sum(lmvfv1.so_weight)) / sum((sum(lmvfv1.so_weight))) OVER (?)) * '100'::numeric), (sum(lmvfv1.do_weight)), (((sum(lmvfv1.do_weight)) / sum((sum(lmvfv1.do_weight))) OVER (?)) * '100'::numeric), (sum((lmvfv1.do_weight + lmvfv1.so_weight))), (((sum((lmvfv1.do_weight + lmvfv1.so_weight))) / sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?)) * '100'::numeric), sum((sum(lmvfv1.so_weight))) OVER (?), sum((sum(lmvfv1.do_weight))) OVER (?), sum((sum((lmvfv1.do_weight + lmvfv1.so_weight)))) OVER (?), count(*) OVER (?), (sum((lmvfv1.so_weight + lmvfv1.do_weight)))
  • Buffers: shared hit=1811 read=44903 dirtied=44 written=1019, temp read=9091 written=12050
4. 104.874 3,255.493 ↓ 2.4 24 1

HashAggregate (cost=14.82..15.40 rows=10 width=29) (actual time=3,255.484..3,255.493 rows=24 loops=1)

  • Output: lmvfv1.person_id, (COALESCE(p.nickname, 'Undefined'::text)), sum(lmvfv1.so_weight), sum(lmvfv1.do_weight), sum((lmvfv1.do_weight + lmvfv1.so_weight)), sum((lmvfv1.so_weight + lmvfv1.do_weight))
  • Group Key: lmvfv1.person_id, COALESCE(p.nickname, 'Undefined'::text)
  • Buffers: shared hit=1811 read=44903 dirtied=44 written=1019, temp read=9091 written=12050
5. 97.795 3,150.619 ↓ 33,021.7 330,217 1

Hash Right Join (cost=12.88..14.32 rows=10 width=29) (actual time=3,053.087..3,150.619 rows=330,217 loops=1)

  • Output: lmvfv1.person_id, COALESCE(p.nickname, 'Undefined'::text), lmvfv1.so_weight, lmvfv1.do_weight
  • Hash Cond: (p.id = lmvfv1.person_id)
  • Buffers: shared hit=1811 read=44903 dirtied=44 written=1019, temp read=9091 written=12050
6. 0.022 0.022 ↓ 1.1 35 1

Seq Scan on public.person p (cost=0.00..1.31 rows=31 width=13) (actual time=0.013..0.022 rows=35 loops=1)

  • Output: p.nickname, p.id
  • Buffers: shared hit=1
7. 57.233 3,052.802 ↓ 33,021.7 330,217 1

Hash (cost=12.75..12.75 rows=10 width=20) (actual time=3,052.802..3,052.802 rows=330,217 loops=1)

  • Output: lmvfv1.person_id, lmvfv1.so_weight, lmvfv1.do_weight
  • Buckets: 65536 (originally 1024) Batches: 64 (originally 1) Memory Usage: 3893kB
  • Buffers: shared hit=1810 read=44903 dirtied=44 written=1019, temp read=5972 written=10434
8. 2,995.569 2,995.569 ↓ 33,021.7 330,217 1

Function Scan on public.flow_1 lmvfv1 (cost=0.25..12.75 rows=10 width=20) (actual time=2,901.265..2,995.569 rows=330,217 loops=1)

  • Output: lmvfv1.person_id, lmvfv1.so_weight, lmvfv1.do_weight
  • Function Call: flow_1('1564869600'::bigint, '1572875314'::bigint)
  • Filter: (lmvfv1.ttr && '["2019-08-03 22:00:00+00","2019-11-04 13:48:34+00")'::tstzrange)
  • Buffers: shared hit=1810 read=44903 dirtied=44 written=1019, temp read=5972 written=8953
Planning time : 0.361 ms
Execution time : 3,256.809 ms