explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mrTv

Settings
# exclusive inclusive rows x rows loops node
1. 0.443 8,150.775 ↑ 1.0 5,000 1

Limit (cost=21,427,603.3..21,427,615.8 rows=5,000 width=31) (actual time=8,150.031..8,150.775 rows=5,000 loops=1)

  • Buffers: shared hit=12,164,937, temp read=146,749 written=147,075
2. 15.623 8,150.332 ↑ 10.4 5,000 1

Sort (cost=21,427,603.3..21,427,733.43 rows=52,051 width=31) (actual time=8,150.03..8,150.332 rows=5,000 loops=1)

  • Sort Key: (sum(pc.phrasecount)) DESC
  • Sort Method: top-N heapsort Memory: 1,043kB
  • Buffers: shared hit=4,107,641, temp read=49,819 written=49,929
3. 23.686 8,134.709 ↑ 1.0 51,411 1

GroupAggregate (cost=21,162,762.2..21,424,145.11 rows=52,051 width=31) (actual time=5,939.186..8,134.709 rows=51,411 loops=1)

  • Group Key: p.phraseid
  • Buffers: shared hit=4,107,641, temp read=49,819 written=49,929
4. 126.981 8,111.023 ↓ 1.5 154,215 1

Gather Merge (cost=21,162,762.2..21,423,104.09 rows=104,102 width=31) (actual time=5,939.15..8,111.023 rows=154,215 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=12,164,937, temp read=146,749 written=147,075
5. 537.972 7,984.042 ↑ 1.0 51,405 3 / 3

GroupAggregate (cost=21,161,762.17..21,410,088.11 rows=52,051 width=31) (actual time=5,887.102..7,984.042 rows=51,405 loops=3)

  • Group Key: p.phraseid
  • Buffers: shared hit=12,164,937, temp read=146,749 written=147,075
6. 877.047 7,446.070 ↑ 2.0 6,105,699 3 / 3

Merge Join (cost=21,161,762.17..21,348,532.96 rows=12,206,927 width=25) (actual time=5,887.069..7,446.07 rows=6,105,699 loops=3)

  • Buffers: shared hit=12,164,937, temp read=146,749 written=147,075
7. 3,684.571 6,525.714 ↑ 2.0 6,105,699 3 / 3

Sort (cost=21,161,761.88..21,192,279.2 rows=12,206,927 width=10) (actual time=5,887.019..6,525.714 rows=6,105,699 loops=3)

  • Sort Key: pc.phraseid
  • Sort Method: external merge Disk: 157,312kB
  • Buffers: shared hit=12,120,652, temp read=146,749 written=147,075
8. 721.211 2,841.143 ↑ 2.0 6,105,699 3 / 3

Nested Loop (cost=1..19,307,698.53 rows=12,206,927 width=10) (actual time=0.058..2,841.143 rows=6,105,699 loops=3)

  • Buffers: shared hit=12,120,644
9. 3.265 3.265 ↑ 1.2 16,667 3 / 3

Index Only Scan using pk_sampledinteractions on sampledinteractions si (cost=0.42..9,807.3 rows=20,817 width=8) (actual time=0.031..3.265 rows=16,667 loops=3)

  • Index Cond: (si.jobid = 'cc55f4c2-682e-423d-b07b-ee744f23308f'::uuid)
  • Buffers: shared hit=320
10. 2,116.667 2,116.667 ↑ 1.6 366 50,000 / 3

Index Scan using pk_phrasecount on phrasecount pc (cost=0.58..921.16 rows=587 width=18) (actual time=0.01..0.127 rows=366 loops=50,000)

  • Index Cond: (pc.interactionid = si.interactionid)
  • Buffers: shared hit=12,120,324
11. 43.309 43.309 ↑ 1.0 52,051 3 / 3

Index Scan using pk_phrase on phrase p (cost=0.29..3,537.05 rows=52,051 width=23) (actual time=0.044..43.309 rows=52,051 loops=3)

  • Buffers: shared hit=44,285
Planning time : 22.599 ms
Execution time : 8,169.334 ms