explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F5cp

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 17,039.711 ↑ 1.0 20 1

Limit (cost=86,595.86..86,595.91 rows=20 width=75) (actual time=17,039.700..17,039.711 rows=20 loops=1)

2.          

CTE raw_tokens_total

3. 0.000 67.743 ↑ 1.0 9 1

Finalize GroupAggregate (cost=7,637.92..7,640.20 rows=9 width=14) (actual time=67.732..67.743 rows=9 loops=1)

  • Group Key: rtt.type
4. 0.000 68.004 ↓ 1.5 27 1

Gather Merge (cost=7,637.92..7,640.02 rows=18 width=14) (actual time=67.725..68.004 rows=27 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.267 181.854 ↑ 1.0 9 3

Sort (cost=6,637.90..6,637.92 rows=9 width=14) (actual time=60.617..60.618 rows=9 loops=3)

  • Sort Key: rtt.type
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
6. 105.522 181.587 ↑ 1.0 9 3

Partial HashAggregate (cost=6,637.66..6,637.75 rows=9 width=14) (actual time=60.527..60.529 rows=9 loops=3)

  • Group Key: rtt.type
7. 76.065 76.065 ↑ 1.2 144,716 3

Parallel Seq Scan on raw_tokens rtt (cost=0.00..5,733.19 rows=180,895 width=6) (actual time=0.036..25.355 rows=144,716 loops=3)

  • Filter: (batch_job_id = 115695)
8. 8.865 17,039.699 ↑ 4,252.5 20 1

Sort (cost=78,955.66..79,168.29 rows=85,050 width=75) (actual time=17,039.696..17,039.699 rows=20 loops=1)

  • Sort Key: ((((count(*))::double precision / (raw_tokens_total.total)::double precision) * '100'::double precision)) DESC
  • Sort Method: top-N heapsort Memory: 28kB
9. 102.733 17,030.834 ↑ 2.0 43,526 1

GroupAggregate (cost=67,393.92..76,692.51 rows=85,050 width=75) (actual time=11,958.352..17,030.834 rows=43,526 loops=1)

  • Group Key: raw_tokens.value, raw_tokens_total.total
10. 16,693.218 16,928.101 ↑ 1.0 434,148 1

Sort (cost=67,393.92..68,479.29 rows=434,148 width=33) (actual time=11,958.340..16,928.101 rows=434,148 loops=1)

  • Sort Key: raw_tokens.value, raw_tokens_total.total
  • Sort Method: external merge Disk: 19816kB
11. 110.325 234.883 ↑ 1.0 434,148 1

Hash Join (cost=0.29..14,868.68 rows=434,148 width=33) (actual time=67.858..234.883 rows=434,148 loops=1)

  • Hash Cond: ((raw_tokens.type)::text = (raw_tokens_total.type)::text)
12. 56.784 56.784 ↑ 1.0 434,148 1

Seq Scan on raw_tokens (cost=0.00..8,898.85 rows=434,148 width=25) (actual time=0.040..56.784 rows=434,148 loops=1)

  • Filter: (batch_job_id = 115695)
13. 0.015 67.774 ↑ 1.0 9 1

Hash (cost=0.18..0.18 rows=9 width=524) (actual time=67.774..67.774 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 67.759 67.759 ↑ 1.0 9 1

CTE Scan on raw_tokens_total (cost=0.00..0.18 rows=9 width=524) (actual time=67.735..67.759 rows=9 loops=1)