explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CWU5

Settings
# exclusive inclusive rows x rows loops node
1. 0.042 14.230 ↑ 29.5 27 1

Sort (cost=2,778.91..2,780.90 rows=796 width=660) (actual time=14.227..14.230 rows=27 loops=1)

  • Sort Key: (min(sr.received_at)) DESC, w.number DESC, s.number DESC
  • Sort Method: quicksort Memory: 32kB
2. 0.102 14.188 ↑ 29.5 27 1

HashAggregate (cost=2,732.60..2,740.56 rows=796 width=660) (actual time=14.173..14.188 rows=27 loops=1)

  • Group Key: w.number, s.number, sr.description, sr.lab_matrix_id, lm.name, fsd.department_id, d.name, sp.functional_structure_id, fs.name
3. 0.031 14.086 ↑ 9.7 82 1

Hash Join (cost=9.04..2,708.72 rows=796 width=660) (actual time=13.747..14.086 rows=82 loops=1)

  • Hash Cond: (fsd.functional_structure_id = fs.id)
4. 0.036 14.004 ↑ 9.7 82 1

Hash Join (cost=5.20..2,702.67 rows=796 width=613) (actual time=13.686..14.004 rows=82 loops=1)

  • Hash Cond: (fsd.department_id = d.id)
5. 0.048 13.958 ↑ 9.7 82 1

Hash Join (cost=3.99..2,698.40 rows=796 width=97) (actual time=13.666..13.958 rows=82 loops=1)

  • Hash Cond: (sp.functional_structure_id = fsd.functional_structure_id)
6. 0.042 13.874 ↑ 9.7 82 1

Nested Loop (cost=1.15..2,684.61 rows=796 width=89) (actual time=13.609..13.874 rows=82 loops=1)

7. 0.005 13.751 ↑ 8.9 27 1

Nested Loop (cost=0.73..2,522.98 rows=241 width=81) (actual time=13.600..13.751 rows=27 loops=1)

8. 0.019 13.692 ↑ 8.9 27 1

Nested Loop (cost=0.58..2,483.17 rows=241 width=60) (actual time=13.586..13.692 rows=27 loops=1)

9. 0.010 13.619 ↑ 9.2 27 1

Nested Loop (cost=0.29..2,398.43 rows=249 width=21) (actual time=13.575..13.619 rows=27 loops=1)

10. 13.565 13.565 ↑ 14.6 11 1

Seq Scan on work_orders w (cost=0.00..1,954.90 rows=161 width=9) (actual time=13.553..13.565 rows=11 loops=1)

  • Filter: (active AND ((received_at)::date >= '2020-06-01'::date) AND ((received_at)::date <= '2020-06-30'::date))
  • Rows Removed by Filter: 32,514
11. 0.044 0.044 ↑ 1.0 2 11

Index Scan using index_samples_on_work_order_id_and_position on samples s (cost=0.29..2.73 rows=2 width=20) (actual time=0.003..0.004 rows=2 loops=11)

  • Index Cond: (work_order_id = w.id)
12. 0.054 0.054 ↑ 1.0 1 27

Index Scan using sample_registrations_pkey on sample_registrations sr (cost=0.29..0.34 rows=1 width=47) (actual time=0.002..0.002 rows=1 loops=27)

  • Index Cond: (id = s.registration_id)
  • Filter: active
13. 0.054 0.054 ↑ 1.0 1 27

Index Scan using lab_matrices_pkey on lab_matrices lm (cost=0.15..0.17 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=27)

  • Index Cond: (id = sr.lab_matrix_id)
14. 0.081 0.081 ↑ 2.0 3 27

Index Scan using index_sample_parameters_on_sample_id_and_position on sample_parameters sp (cost=0.42..0.61 rows=6 width=16) (actual time=0.002..0.003 rows=3 loops=27)

  • Index Cond: (sample_id = s.id)
15. 0.013 0.036 ↑ 1.0 82 1

Hash (cost=1.82..1.82 rows=82 width=8) (actual time=0.036..0.036 rows=82 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
16. 0.023 0.023 ↑ 1.0 82 1

Seq Scan on functional_structures_departments fsd (cost=0.00..1.82 rows=82 width=8) (actual time=0.014..0.023 rows=82 loops=1)

17. 0.004 0.010 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=520) (actual time=0.010..0.010 rows=9 loops=1)

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

Seq Scan on departments d (cost=0.00..1.09 rows=9 width=520) (actual time=0.005..0.006 rows=9 loops=1)

19. 0.028 0.051 ↑ 1.0 82 1

Hash (cost=2.82..2.82 rows=82 width=55) (actual time=0.051..0.051 rows=82 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
20. 0.023 0.023 ↑ 1.0 82 1

Seq Scan on functional_structures fs (cost=0.00..2.82 rows=82 width=55) (actual time=0.012..0.023 rows=82 loops=1)