explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UAjm

Settings
# exclusive inclusive rows x rows loops node
1. 0.509 26,585.922 ↑ 1.0 5,000 1

Limit (cost=77,867,869.33..77,867,881.83 rows=5,000 width=31) (actual time=26,585.106..26,585.922 rows=5,000 loops=1)

  • Buffers: shared hit=8,269,553, temp read=99,050 written=99,370
2. 16.417 26,585.413 ↑ 10.3 5,000 1

Sort (cost=77,867,869.33..77,867,998.05 rows=51,487 width=31) (actual time=26,585.105..26,585.413 rows=5,000 loops=1)

  • Sort Key: (sum(pc.phrasecount)) DESC
  • Sort Method: top-N heapsort Memory: 1,043kB
  • Buffers: shared hit=1,034,341, temp read=12,626 written=12,667
3. 47.195 26,568.996 ↑ 1.0 51,411 1

GroupAggregate (cost=74,384,514.09..77,864,448.61 rows=51,487 width=31) (actual time=25,485.113..26,568.996 rows=51,411 loops=1)

  • Group Key: p.phraseid
  • Buffers: shared hit=1,034,341, temp read=12,626 written=12,667
4. 129.271 26,521.801 ↓ 1.1 411,158 1

Gather Merge (cost=74,384,514.09..77,862,131.69 rows=360,409 width=31) (actual time=25,485.082..26,521.801 rows=411,158 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
  • Buffers: shared hit=8,269,553, temp read=99,050 written=99,370
5. 221.441 26,392.530 ↑ 1.0 51,395 8 / 8

GroupAggregate (cost=74,383,513.97..77,816,981.47 rows=51,487 width=31) (actual time=25,448.464..26,392.53 rows=51,395 loops=8)

  • Group Key: p.phraseid
  • Buffers: shared hit=8,269,553, temp read=99,050 written=99,370
6. 354.473 26,171.089 ↑ 74.9 2,289,637 8 / 8

Merge Join (cost=74,383,513.97..76,958,623.1 rows=171,568,699 width=25) (actual time=25,448.446..26,171.089 rows=2,289,637 loops=8)

  • Buffers: shared hit=8,269,553, temp read=99,050 written=99,370
7. 1,384.579 25,730.808 ↑ 74.9 2,289,637 8 / 8

Sort (cost=74,383,502.32..74,812,424.07 rows=171,568,699 width=10) (actual time=25,448.397..25,730.808 rows=2,289,637 loops=8)

  • Sort Key: pc.phraseid
  • Sort Method: external merge Disk: 59,016kB
  • Buffers: shared hit=8,151,458, temp read=99,050 written=99,370
8. 14,072.057 24,346.229 ↑ 74.9 2,289,637 8 / 8

Hash Join (cost=4,952.42..34,581,979.24 rows=171,568,699 width=10) (actual time=128.75..24,346.229 rows=2,289,637 loops=8)

  • Buffers: shared hit=8,151,430
9. 10,149.037 10,149.037 ↑ 1.1 158,428,896 8 / 8

Seq Scan on phrasecount pc (cost=0..34,101,778.17 rows=181,032,617 width=18) (actual time=0.006..10,149.037 rows=158,428,896 loops=8)

  • Buffers: shared hit=8,072,863
10. 8.286 125.135 ↑ 1.0 50,000 8 / 8

Hash (cost=4,325.01..4,325.01 rows=50,193 width=8) (actual time=125.135..125.135 rows=50,000 loops=8)

  • Buffers: shared hit=78,511
11. 116.849 116.849 ↑ 1.0 50,000 8 / 8

Index Only Scan using pk_sampledinteractions on sampledinteractions si (cost=0.42..4,325.01 rows=50,193 width=8) (actual time=0.014..116.849 rows=50,000 loops=8)

  • Index Cond: (si.jobid = 'cc55f4c2-682e-423d-b07b-ee744f23308f'::uuid)
  • Heap Fetches: 50,000
  • Buffers: shared hit=78,511
12. 85.808 85.808 ↓ 1.0 52,051 8 / 8

Index Scan using pk_phrase on phrase p (cost=0.29..1,461.61 rows=51,487 width=23) (actual time=0.044..85.808 rows=52,051 loops=8)

  • Buffers: shared hit=118,095
Planning time : 0.515 ms
Execution time : 26,594.017 ms