explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Kojy

Settings
# exclusive inclusive rows x rows loops node
1. 1.565 22,439.286 ↓ 398.0 398 1

Nested Loop Left Join (cost=25,160.72..26,186.97 rows=1 width=659) (actual time=55.512..22,439.286 rows=398 loops=1)

2. 150.763 22,434.935 ↓ 398.0 398 1

Nested Loop Left Join (cost=25,160.44..26,186.53 rows=1 width=251) (actual time=55.498..22,434.935 rows=398 loops=1)

  • Join Filter: (results.result_query_id = queries.query_id)
  • Rows Removed by Join Filter: 1,877,764
3. 1.934 22,081.988 ↓ 398.0 398 1

Nested Loop Left Join (cost=25,160.44..26,000.38 rows=1 width=245) (actual time=54.930..22,081.988 rows=398 loops=1)

  • Join Filter: (result_states.rs_pr_id = burl.burl_original_pr_id)
4. 2.592 22,076.074 ↓ 398.0 398 1

Nested Loop Left Join (cost=25,160.16..25,999.96 rows=1 width=245) (actual time=54.910..22,076.074 rows=398 loops=1)

5. 1.146 51.346 ↓ 398.0 398 1

Nested Loop Left Join (cost=5.87..88.82 rows=1 width=148) (actual time=0.107..51.346 rows=398 loops=1)

6. 1.272 49.006 ↓ 398.0 398 1

Nested Loop Left Join (cost=5.73..88.65 rows=1 width=147) (actual time=0.096..49.006 rows=398 loops=1)

7. 1.251 44.948 ↓ 398.0 398 1

Nested Loop Left Join (cost=5.31..78.75 rows=1 width=50) (actual time=0.083..44.948 rows=398 loops=1)

  • Join Filter: (scan_to_result.sr_sast_scan_id = result_states.rs_sast_scan_id)
8. 1.501 4.693 ↓ 398.0 398 1

Nested Loop (cost=4.89..65.68 rows=1 width=44) (actual time=0.052..4.693 rows=398 loops=1)

9. 0.373 0.406 ↓ 79.6 398 1

Bitmap Heap Scan on scan_to_results scan_to_result (cost=4.47..23.48 rows=5 width=22) (actual time=0.039..0.406 rows=398 loops=1)

  • Recheck Cond: ((sr_sast_scan_id = 19) AND (customer_id = 5,459))
  • Heap Blocks: exact=8
10. 0.033 0.033 ↓ 79.6 398 1

Bitmap Index Scan on scan_to_results_sr_sast_scan_id_customer_id_idx (cost=0.00..4.47 rows=5 width=0) (actual time=0.033..0.033 rows=398 loops=1)

  • Index Cond: ((sr_sast_scan_id = 19) AND (customer_id = 5,459))
11. 2.786 2.786 ↑ 1.0 1 398

Index Scan using pk_results on results (cost=0.42..8.44 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=398)

  • Index Cond: (result_id = scan_to_result.sr_result_id)
  • Filter: (customer_id = 5,459)
12. 39.004 39.004 ↑ 1.0 1 398

Index Scan using result_states_rs_sast_scan_id_customer_id_idx on result_states (cost=0.42..13.05 rows=1 width=24) (actual time=0.055..0.098 rows=1 loops=398)

  • Index Cond: ((rs_sast_scan_id = 19) AND (results.customer_id = customer_id) AND (customer_id = 5,459))
  • Filter: (results.result_id = rs_result_id)
  • Rows Removed by Filter: 397
13. 2.786 2.786 ↑ 1.0 1 398

Index Scan using pk_nodes on nodes source_nodes (cost=0.42..9.89 rows=1 width=107) (actual time=0.006..0.007 rows=1 loops=398)

  • Index Cond: ((results.result_id = node_result_id) AND (node_order = 0))
  • Filter: ((customer_id = 5,459) AND (results.customer_id = customer_id))
14. 1.194 1.194 ↓ 0.0 0 398

Index Scan using pk_result_attributes on result_attributes (cost=0.14..0.17 rows=1 width=9) (actual time=0.003..0.003 rows=0 loops=398)

  • Index Cond: (results.result_id = ra_result_id)
15. 46.964 22,022.136 ↑ 1.0 1 398

Merge Semi Join (cost=25,154.29..25,911.13 rows=1 width=107) (actual time=55.331..55.332 rows=1 loops=398)

  • Merge Cond: (nodes.node_result_id = nodes_1.node_result_id)
  • Join Filter: (nodes.node_order = (max(nodes_1.node_order)))
  • Rows Removed by Join Filter: 6
16. 4.776 4.776 ↓ 7.0 7 398

Index Scan using node_result_id_idx on nodes (cost=0.42..13.40 rows=1 width=109) (actual time=0.006..0.012 rows=7 loops=398)

  • Index Cond: (results.result_id = node_result_id)
  • Filter: ((customer_id = 5,459) AND (results.customer_id = customer_id))
17. 71.640 21,970.396 ↑ 5.3 1,003 398

Materialize (cost=25,153.86..25,884.42 rows=5,317 width=12) (actual time=53.583..55.202 rows=1,003 loops=398)

18. 140.494 21,898.756 ↑ 5.3 998 398

Finalize GroupAggregate (cost=25,153.86..25,817.96 rows=5,317 width=12) (actual time=53.582..55.022 rows=998 loops=398)

  • Group Key: nodes_1.customer_id, nodes_1.node_result_id
19. 1,900.450 21,758.262 ↑ 4.6 999 398

Gather Merge (cost=25,153.86..25,730.32 rows=4,596 width=12) (actual time=53.576..54.669 rows=999 loops=398)

  • Workers Planned: 2
  • Workers Launched: 2
20. 197.408 19,857.812 ↑ 5.9 388 1,194 / 3

Partial GroupAggregate (cost=24,153.84..24,199.80 rows=2,298 width=12) (actual time=49.253..49.894 rows=388 loops=1,194)

  • Group Key: nodes_1.customer_id, nodes_1.node_result_id
21. 287.356 19,660.404 ↓ 1.2 2,646 1,194 / 3

Sort (cost=24,153.84..24,159.59 rows=2,298 width=12) (actual time=49.236..49.398 rows=2,646 loops=1,194)

  • Sort Key: nodes_1.node_result_id
  • Sort Method: quicksort Memory: 157kB
22. 19,373.048 19,373.048 ↓ 1.2 2,714 1,194 / 3

Parallel Seq Scan on nodes nodes_1 (cost=0.00..24,025.54 rows=2,298 width=12) (actual time=34.727..48.676 rows=2,714 loops=1,194)

  • Filter: (customer_id = 5,459)
  • Rows Removed by Filter: 224,201
23. 3.980 3.980 ↓ 0.0 0 398

Index Scan using pk_business_unit_result_labels on business_unit_result_labels burl (cost=0.28..0.41 rows=1 width=16) (actual time=0.010..0.010 rows=0 loops=398)

  • Index Cond: ((results.result_similarity_id = burl_similarity_id) AND (results.customer_id = customer_id) AND (customer_id = 5,459))
24. 202.184 202.184 ↓ 1.0 4,719 398

Seq Scan on queries (cost=0.00..127.18 rows=4,718 width=10) (actual time=0.004..0.508 rows=4,719 loops=398)

25. 2.786 2.786 ↑ 1.0 1 398

Index Scan using pk_query_description_query_id on query_description (cost=0.28..0.44 rows=1 width=422) (actual time=0.007..0.007 rows=1 loops=398)

  • Index Cond: (queries.query_id = query_id)