explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o1Mx : group by

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=1,494,190,496.32..1,494,190,746.32 rows=100,000 width=162) (actual rows= loops=)

  • Sort Key: batch_search.batch_date DESC, batch_search_query.query_number
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=235,435.92..1,494,173,987.50 rows=100,000 width=162) (actual rows= loops=)

  • Hash Cond: ((batch_search_query.query = countbyquery.query) AND (batch_search.uuid = countbyquery.search_uuid))
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.50..2,309.12 rows=100,000 width=134) (actual rows= loops=)

  • Hash Cond: (batch_search_query.search_uuid = batch_search.uuid)
4. 0.000 0.000 ↓ 0.0

Seq Scan on batch_search_query (cost=0.00..2,031.00 rows=100,000 width=50) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash (cost=3.25..3.25 rows=100 width=121) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on batch_search (cost=0.00..3.25 rows=100 width=121) (actual rows= loops=)

  • Filter: ((state)::text = 'QUEUED'::text)
7. 0.000 0.000 ↓ 0.0

Hash (cost=232,954.42..232,954.42 rows=100,000 width=54) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Subquery Scan on countbyquery (cost=212,073.00..232,954.42 rows=100,000 width=54) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=212,073.00..231,954.42 rows=100,000 width=54) (actual rows= loops=)

  • Group Key: batch_search_query_1.query, batch_search_result.search_uuid
10. 0.000 0.000 ↓ 0.0

Gather Merge (cost=212,073.00..230,204.42 rows=100,000 width=54) (actual rows= loops=)

  • Workers Planned: 1
11. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=211,072.99..217,954.41 rows=100,000 width=54) (actual rows= loops=)

  • Group Key: batch_search_query_1.query, batch_search_result.search_uuid
12. 0.000 0.000 ↓ 0.0

Sort (cost=211,072.99..212,543.34 rows=588,142 width=46) (actual rows= loops=)

  • Sort Key: batch_search_query_1.query, batch_search_result.search_uuid
13. 0.000 0.000 ↓ 0.0

Parallel Hash Left Join (cost=29,464.93..136,616.91 rows=588,142 width=46) (actual rows= loops=)

  • Hash Cond: ((batch_search_query_1.query = batch_search_result.query) AND (batch_search_query_1.search_uuid = batch_search_result.search_uuid))
14. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on batch_search_query batch_search_query_1 (cost=0.00..1,619.24 rows=58,824 width=46) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=19,551.77..19,551.77 rows=416,677 width=46) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on batch_search_result (cost=0.00..19,551.77 rows=416,677 width=46) (actual rows= loops=)

17.          

SubPlan (for Hash Left Join)

18. 0.000 0.000 ↓ 0.0

Aggregate (cost=14,939.30..14,939.31 rows=1 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on batch_search_result batch_search_result_1 (cost=457.93..14,914.30 rows=10,000 width=0) (actual rows= loops=)

  • Recheck Cond: (search_uuid = batch_search.uuid)
20. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on batch_search_result_uuid (cost=0.00..455.43 rows=10,000 width=0) (actual rows= loops=)

  • Index Cond: (search_uuid = batch_search.uuid)