explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4ZnO

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

Limit (cost=22,218,918.31..22,218,930.81 rows=5,000 width=31) (actual time=8,004.863..8,005.593 rows=5,000 loops=1)

  • Buffers: shared hit=12,174,431, temp read=146,289 written=146,614
2. 15.459 8,005.158 ↑ 10.3 5,000 1

Sort (cost=22,218,918.31..22,219,047.03 rows=51,487 width=31) (actual time=8,004.862..8,005.158 rows=5,000 loops=1)

  • Sort Key: (sum(pc.phrasecount)) DESC
  • Sort Method: top-N heapsort Memory: 1,043kB
  • Buffers: shared hit=4,086,746, temp read=49,230 written=49,339
3. 23.639 7,989.699 ↑ 1.0 51,411 1

GroupAggregate (cost=21,942,006.06..22,215,497.59 rows=51,487 width=31) (actual time=5,813.852..7,989.699 rows=51,411 loops=1)

  • Group Key: p.phraseid
  • Buffers: shared hit=4,086,746, temp read=49,230 written=49,339
4. 84.784 7,966.060 ↓ 1.5 154,215 1

Gather Merge (cost=21,942,006.06..22,214,467.85 rows=102,974 width=31) (actual time=5,813.808..7,966.06 rows=154,215 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=12,174,431, temp read=146,289 written=146,614
5. 536.954 7,881.276 ↑ 1.0 51,405 3 / 3

GroupAggregate (cost=21,941,006.04..22,201,582.07 rows=51,487 width=31) (actual time=5,786.875..7,881.276 rows=51,405 loops=3)

  • Group Key: p.phraseid
  • Buffers: shared hit=12,174,431, temp read=146,289 written=146,614
6. 876.733 7,344.322 ↑ 2.1 6,105,699 3 / 3

Merge Join (cost=21,941,006.04..22,136,945.2 rows=12,824,399 width=25) (actual time=5,786.843..7,344.322 rows=6,105,699 loops=3)

  • Buffers: shared hit=12,174,431, temp read=146,289 written=146,614
7. 3,576.204 6,423.538 ↑ 2.1 6,105,699 3 / 3

Sort (cost=21,941,004.21..21,973,065.2 rows=12,824,399 width=10) (actual time=5,786.793..6,423.538 rows=6,105,699 loops=3)

  • Sort Key: pc.phraseid
  • Sort Method: external merge Disk: 156,280kB
  • Buffers: shared hit=12,130,146, temp read=146,289 written=146,614
8. 714.338 2,847.334 ↑ 2.1 6,105,699 3 / 3

Nested Loop (cost=1..19,988,590.79 rows=12,824,399 width=10) (actual time=0.092..2,847.334 rows=6,105,699 loops=3)

  • Buffers: shared hit=12,130,138
9. 16.329 16.329 ↑ 1.3 16,667 3 / 3

Index Only Scan using pk_sampledinteractions on sampledinteractions si (cost=0.42..14,077.48 rows=21,861 width=8) (actual time=0.071..16.329 rows=16,667 loops=3)

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

Index Scan using pk_phrasecount on phrasecount pc (cost=0.58..907.84 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. 44.051 44.051 ↓ 1.0 52,051 3 / 3

Index Scan using pk_phrase on phrase p (cost=0.29..3,528.58 rows=51,487 width=23) (actual time=0.043..44.051 rows=52,051 loops=3)

  • Buffers: shared hit=44,285
Planning time : 10.05 ms
Execution time : 8,023.854 ms