explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yR9t

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 59,534.562 ↑ 1.0 1 1

Sort (cost=1,205,645.43..1,205,645.44 rows=1 width=1,355) (actual time=59,534.561..59,534.562 rows=1 loops=1)

  • Sort Key: s0_.id
  • Sort Method: quicksort Memory: 25kB
2. 953.050 59,534.530 ↑ 1.0 1 1

Gather (cost=168,257.39..1,205,645.42 rows=1 width=1,355) (actual time=58,648.545..59,534.530 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 424.549 58,581.480 ↓ 0.0 0 3 / 3

Hash Semi Join (cost=167,257.39..1,204,645.32 rows=1 width=1,355) (actual time=58,286.162..58,581.480 rows=0 loops=3)

  • Hash Cond: (s0_.id = s5_.id)
4. 1,355.581 50,574.306 ↑ 1.2 2,333,107 3 / 3

Hash Left Join (cost=167,131.51..1,196,874.07 rows=2,912,523 width=1,355) (actual time=3,107.239..50,574.306 rows=2,333,107 loops=3)

  • Hash Cond: (s0_.unitary_demand_id = u3_.id)
5. 20,094.893 49,218.421 ↑ 1.2 2,333,107 3 / 3

Hash Left Join (cost=167,115.62..1,160,153.01 rows=2,912,523 width=1,264) (actual time=3,106.906..49,218.421 rows=2,333,107 loops=3)

  • Hash Cond: (s1_.specimen_group_id = s2_.id)
6. 14,017.145 28,612.193 ↑ 1.2 2,333,107 3 / 3

Hash Left Join (cost=125,484.96..666,305.84 rows=2,912,523 width=515) (actual time=2,550.894..28,612.193 rows=2,333,107 loops=3)

  • Hash Cond: (s0_.specimen_id = s1_.id)
7. 12,051.936 12,051.936 ↑ 1.2 2,333,107 3 / 3

Parallel Seq Scan on specimen_unitary_demand s0_ (cost=0.00..169,031.28 rows=2,912,523 width=388) (actual time=0.018..12,051.936 rows=2,333,107 loops=3)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 68,869
8. 1,608.616 2,543.112 ↓ 1.0 2,119,100 3 / 3

Hash (cost=59,851.51..59,851.51 rows=2,113,476 width=127) (actual time=2,543.112..2,543.112 rows=2,119,100 loops=3)

  • Buckets: 32,768 Batches: 128 Memory Usage: 2,583kB
9. 934.496 934.496 ↓ 1.0 2,119,100 3 / 3

Seq Scan on specimen s1_ (cost=0.00..59,851.51 rows=2,113,476 width=127) (actual time=0.009..934.496 rows=2,119,100 loops=3)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 31,279
10. 370.068 511.335 ↓ 1.0 303,644 3 / 3

Hash (cost=9,227.25..9,227.25 rows=302,193 width=749) (actual time=511.335..511.335 rows=303,644 loops=3)

  • Buckets: 8,192 Batches: 64 Memory Usage: 871kB
11. 141.267 141.267 ↓ 1.0 303,644 3 / 3

Seq Scan on specimen_group s2_ (cost=0.00..9,227.25 rows=302,193 width=749) (actual time=0.019..141.267 rows=303,644 loops=3)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 4,124
12. 0.171 0.304 ↓ 1.0 411 3 / 3

Hash (cost=10.95..10.95 rows=395 width=91) (actual time=0.304..0.304 rows=411 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 59kB
13. 0.133 0.133 ↓ 1.0 411 3 / 3

Seq Scan on unitary_demand u3_ (cost=0.00..10.95 rows=395 width=91) (actual time=0.012..0.133 rows=411 loops=3)

14. 0.004 7,582.625 ↑ 1.0 1 3 / 3

Hash (cost=125.87..125.87 rows=1 width=16) (actual time=7,582.625..7,582.625 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.241 7,582.621 ↑ 1.0 1 3 / 3

Nested Loop (cost=1.98..125.87 rows=1 width=16) (actual time=105.204..7,582.621 rows=1 loops=3)

16. 0.300 7,581.084 ↓ 162.0 162 3 / 3

Nested Loop (cost=1.56..125.41 rows=1 width=32) (actual time=105.182..7,581.084 rows=162 loops=3)

17. 3.567 7,325.796 ↓ 162.0 162 3 / 3

Nested Loop (cost=1.14..124.64 rows=1 width=32) (actual time=105.152..7,325.796 rows=162 loops=3)

18. 4.103 48.559 ↓ 1,605.7 4,817 3 / 3

Nested Loop (cost=0.71..100.16 rows=3 width=32) (actual time=22.704..48.559 rows=4,817 loops=3)

  • Join Filter: (s5_.unitary_demand_id = u8_.id)
  • Rows Removed by Join Filter: 2,494
19. 0.040 0.040 ↑ 1.0 1 3 / 3

Index Scan using unitary_demand_code_solution_idx on unitary_demand u8_ (cost=0.27..8.29 rows=1 width=16) (actual time=0.039..0.040 rows=1 loops=3)

  • Index Cond: ((code_solution)::text = 'INH_DEPISTAGE'::text)
20. 44.416 44.416 ↓ 5.7 7,311 3 / 3

Index Scan using specimen_unitary_demand_created_at_idx on specimen_unitary_demand s5_ (cost=0.43..75.83 rows=1,283 width=48) (actual time=22.662..44.416 rows=7,311 loops=3)

  • Index Cond: ((created_at <= '2020-09-29 00:00:00'::timestamp without time zone) AND (created_at >= '2020-09-28 00:00:00'::timestamp without time zone))
  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 16
21. 7,273.670 7,273.670 ↓ 0.0 0 14,451 / 3

Index Scan using specimen_pk on specimen s6_ (cost=0.43..8.16 rows=1 width=32) (actual time=1.510..1.510 rows=0 loops=14,451)

  • Index Cond: (id = s5_.specimen_id)
  • Filter: ((deleted_at IS NULL) AND (position_basket = '1'::smallint))
  • Rows Removed by Filter: 1
22. 254.988 254.988 ↑ 1.0 1 486 / 3

Index Scan using tour_pk on specimen_group s7_ (cost=0.42..0.77 rows=1 width=32) (actual time=1.574..1.574 rows=1 loops=486)

  • Index Cond: (id = s6_.specimen_group_id)
  • Filter: (deleted_at IS NULL)
23. 1.296 1.296 ↓ 0.0 0 486 / 3

Index Scan using basket_pk on basket b9_ (cost=0.42..0.46 rows=1 width=16) (actual time=0.008..0.008 rows=0 loops=486)

  • Index Cond: (id = s7_.basket_id)
  • Filter: ((deleted_at IS NULL) AND (number = 1))
  • Rows Removed by Filter: 1
Planning time : 3.090 ms
Execution time : 59,539.544 ms