explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HlfB : group by

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

Sort (cost=321.55..321.56 rows=1 width=1,785) (actual rows= loops=)

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

Nested Loop Left Join (cost=157.05..321.54 rows=1 width=1,785) (actual rows= loops=)

  • Join Filter: ((batch_search_query_1.query = batch_search_query.query) AND (batch_search_result.search_uuid = batch_search.uuid))
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..145.59 rows=1 width=1,757) (actual rows= loops=)

  • Join Filter: (batch_search.uuid = batch_search_query.search_uuid)
4. 0.000 0.000 ↓ 0.0

Seq Scan on batch_search (cost=0.00..10.50 rows=1 width=1,750) (actual rows= loops=)

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

Seq Scan on batch_search_query (cost=0.00..135.04 rows=4 width=44) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=157.05..157.13 rows=4 width=48) (actual rows= loops=)

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

Sort (cost=157.05..157.06 rows=4 width=40) (actual rows= loops=)

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

Hash Right Join (cost=135.10..157.01 rows=4 width=40) (actual rows= loops=)

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

Seq Scan on batch_search_result (cost=0.00..16.80 rows=680 width=46) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=135.04..135.04 rows=4 width=40) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on batch_search_query batch_search_query_1 (cost=0.00..135.04 rows=4 width=40) (actual rows= loops=)

12.          

SubPlan (for Nested Loop Left Join)

13. 0.000 0.000 ↓ 0.0

Aggregate (cost=18.71..18.72 rows=1 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on batch_search_result batch_search_result_1 (cost=0.00..18.50 rows=85 width=0) (actual rows= loops=)

  • Filter: (search_uuid = batch_search.uuid)