explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HVeF

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 40,071.244 ↑ 1.0 1 1

Limit (cost=773,647.29..773,647.30 rows=1 width=32) (actual time=40,071.241..40,071.244 rows=1 loops=1)

2. 0.004 40,071.242 ↑ 1.0 1 1

Unique (cost=773,647.29..773,647.30 rows=1 width=32) (actual time=40,071.239..40,071.242 rows=1 loops=1)

3. 0.025 40,071.238 ↑ 1.0 1 1

Sort (cost=773,647.29..773,647.30 rows=1 width=32) (actual time=40,071.237..40,071.238 rows=1 loops=1)

  • Sort Key: s0_.id
  • Sort Method: quicksort Memory: 25kB
4. 3,609.994 40,071.213 ↑ 1.0 1 1

Hash Semi Join (cost=620,796.79..773,647.28 rows=1 width=32) (actual time=34,283.439..40,071.213 rows=1 loops=1)

  • Hash Cond: (s0_.id = s7_.id)
5. 10,444.584 36,125.624 ↑ 1.0 11,632,735 1

Hash Right Join (cost=610,675.46..732,912.05 rows=11,662,431 width=16) (actual time=25,298.047..36,125.624 rows=11,632,735 loops=1)

  • Hash Cond: (s4_.specimen_unitary_demand_id = s0_.id)
6. 390.213 390.213 ↓ 1.0 297,147 1

Seq Scan on specimen_unitary_demand_result s4_ (cost=0.00..8,735.28 rows=296,794 width=16) (actual time=0.222..390.213 rows=297,147 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 28,881
7. 14,097.907 25,290.827 ↑ 1.0 11,632,735 1

Hash (cost=362,393.07..362,393.07 rows=11,662,431 width=48) (actual time=25,290.827..25,290.827 rows=11,632,735 loops=1)

  • Buckets: 65,536 Batches: 512 Memory Usage: 2,276kB
8. 11,192.920 11,192.920 ↑ 1.0 11,632,735 1

Seq Scan on specimen_unitary_demand s0_ (cost=0.00..362,393.07 rows=11,662,431 width=48) (actual time=0.081..11,192.920 rows=11,632,735 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 261,270
9. 0.011 335.595 ↑ 1.0 1 1

Hash (cost=10,121.32..10,121.32 rows=1 width=16) (actual time=335.595..335.595 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
10. 0.006 335.584 ↑ 1.0 1 1

Nested Loop (cost=208.60..10,121.32 rows=1 width=16) (actual time=335.497..335.584 rows=1 loops=1)

11. 0.007 335.556 ↓ 2.0 2 1

Nested Loop (cost=208.18..10,120.19 rows=1 width=32) (actual time=335.481..335.556 rows=2 loops=1)

12. 0.219 335.527 ↓ 2.0 2 1

Nested Loop (cost=207.75..10,118.80 rows=1 width=32) (actual time=335.465..335.527 rows=2 loops=1)

13. 165.930 334.688 ↓ 7.8 62 1

Hash Right Join (cost=207.32..10,055.59 rows=8 width=32) (actual time=334.647..334.688 rows=62 loops=1)

  • Hash Cond: (s11_.specimen_unitary_demand_id = s7_.id)
14. 168.532 168.532 ↓ 1.0 297,147 1

Seq Scan on specimen_unitary_demand_result s11_ (cost=0.00..8,735.28 rows=296,794 width=16) (actual time=0.105..168.532 rows=297,147 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 28,881
15. 0.034 0.226 ↓ 7.8 62 1

Hash (cost=207.22..207.22 rows=8 width=32) (actual time=0.226..0.226 rows=62 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
16. 0.080 0.192 ↓ 7.8 62 1

Hash Join (cost=8.74..207.22 rows=8 width=32) (actual time=0.102..0.192 rows=62 loops=1)

  • Hash Cond: (s7_.unitary_demand_id = u10_.id)
17. 0.080 0.080 ↑ 38.3 90 1

Index Scan using specimen_unitary_demand_created_at_idx on specimen_unitary_demand s7_ (cost=0.43..185.91 rows=3,449 width=48) (actual time=0.029..0.080 rows=90 loops=1)

  • 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)
18. 0.004 0.032 ↑ 1.0 1 1

Hash (cost=8.29..8.29 rows=1 width=16) (actual time=0.032..0.032 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.028 0.028 ↑ 1.0 1 1

Index Scan using unitary_demand_code_solution_idx on unitary_demand u10_ (cost=0.27..8.29 rows=1 width=16) (actual time=0.026..0.028 rows=1 loops=1)

  • Index Cond: ((code_solution)::text = 'INH_DEPISTAGE'::text)
20. 0.620 0.620 ↓ 0.0 0 62

Index Scan using specimen_pk on specimen s8_ (cost=0.43..7.89 rows=1 width=32) (actual time=0.010..0.010 rows=0 loops=62)

  • Index Cond: (id = s7_.specimen_id)
  • Filter: ((deleted_at IS NULL) AND (position_basket = '1'::smallint))
  • Rows Removed by Filter: 1
21. 0.022 0.022 ↑ 1.0 1 2

Index Scan using tour_pk on specimen_group s9_ (cost=0.42..1.38 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=2)

  • Index Cond: (id = s8_.specimen_group_id)
  • Filter: (deleted_at IS NULL)
22. 0.022 0.022 ↓ 0.0 0 2

Index Scan using basket_pk on basket b13_ (cost=0.42..1.12 rows=1 width=16) (actual time=0.011..0.011 rows=0 loops=2)

  • Index Cond: (id = s9_.basket_id)
  • Filter: ((deleted_at IS NULL) AND (number = 1))
  • Rows Removed by Filter: 0
Planning time : 7.457 ms
Execution time : 40,071.491 ms