explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vnXG

Settings
# exclusive inclusive rows x rows loops node
1. 122.725 2,677.987 ↑ 12.6 24,534 1

Nested Loop Left Join (cost=45,530.50..12,596,537.15 rows=308,215 width=1,331) (actual time=417.133..2,677.987 rows=24,534 loops=1)

2. 15.196 1,117.716 ↓ 1.1 24,534 1

Nested Loop Left Join (cost=45,530.50..54,307.36 rows=21,836 width=1,304) (actual time=416.970..1,117.716 rows=24,534 loops=1)

3. 10.787 783.578 ↓ 15.9 24,534 1

Hash Left Join (cost=45,530.50..53,789.90 rows=1,547 width=1,296) (actual time=416.932..783.578 rows=24,534 loops=1)

  • Hash Cond: (sr.sample_reference_id = sre.id)
4. 12.889 772.573 ↓ 15.9 24,534 1

Hash Join (cost=45,511.87..53,767.21 rows=1,547 width=1,266) (actual time=416.696..772.573 rows=24,534 loops=1)

  • Hash Cond: (sr.lab_matrix_id = lm.id)
5. 15.348 759.532 ↓ 15.9 24,534 1

Hash Join (cost=45,495.24..53,746.46 rows=1,547 width=1,245) (actual time=416.531..759.532 rows=24,534 loops=1)

  • Hash Cond: (sp.functional_structure_id = fsd.functional_structure_id)
6. 15.506 743.979 ↓ 15.9 24,534 1

Hash Join (cost=45,486.80..53,716.76 rows=1,547 width=674) (actual time=416.317..743.979 rows=24,534 loops=1)

  • Hash Cond: (spa.analytical_parameter_id = ap.id)
7. 14.768 726.637 ↓ 15.9 24,534 1

Hash Join (cost=45,257.03..53,482.92 rows=1,547 width=628) (actual time=414.459..726.637 rows=24,534 loops=1)

  • Hash Cond: (sp.sample_type_id = st.id)
8. 26.985 711.855 ↓ 15.9 24,534 1

Nested Loop (cost=45,255.85..53,475.53 rows=1,547 width=112) (actual time=414.432..711.855 rows=24,534 loops=1)

9. 37.890 635.802 ↓ 15.9 24,534 1

Nested Loop (cost=45,255.56..52,947.62 rows=1,547 width=92) (actual time=414.422..635.802 rows=24,534 loops=1)

10. 100.533 548.844 ↓ 15.9 24,534 1

Hash Join (cost=45,255.27..52,427.42 rows=1,547 width=73) (actual time=414.397..548.844 rows=24,534 loops=1)

  • Hash Cond: ((spa.analytical_parameter_id = sp.parameter_id) AND (spa.sample_registration_id = s.registration_id))
11. 34.503 34.503 ↓ 1.0 172,987 1

Seq Scan on sample_parameter_assignments spa (cost=0.00..3,884.53 rows=172,953 width=8) (actual time=0.007..34.503 rows=172,987 loops=1)

12. 10.626 413.808 ↑ 2.0 24,534 1

Hash (cost=43,896.52..43,896.52 rows=49,050 width=73) (actual time=413.808..413.808 rows=24,534 loops=1)

  • Buckets: 65,536 Batches: 2 Memory Usage: 1,773kB
13. 11.375 403.182 ↑ 2.0 24,534 1

Hash Join (cost=34,789.71..43,896.52 rows=49,050 width=73) (actual time=314.884..403.182 rows=24,534 loops=1)

  • Hash Cond: (q.sample_id = s.id)
14. 48.231 369.365 ↑ 2.0 24,534 1

Hash Join (cost=32,433.71..41,411.75 rows=49,050 width=61) (actual time=292.072..369.365 rows=24,534 loops=1)

  • Hash Cond: (q.sample_parameter_id = sp.id)
15. 2.219 205.974 ↑ 2.0 24,534 1

Subquery Scan on q (cost=23,905.83..30,780.12 rows=49,050 width=32) (actual time=176.012..205.974 rows=24,534 loops=1)

16. 8.261 203.755 ↑ 2.0 24,534 1

Finalize GroupAggregate (cost=23,905.83..30,289.62 rows=49,050 width=32) (actual time=176.011..203.755 rows=24,534 loops=1)

  • Group Key: w_1.id, s_1.id, sp_1.id, sr_1.id
17. 53.769 195.494 ↑ 1.6 26,271 1

Gather Merge (cost=23,905.83..29,185.98 rows=40,876 width=32) (actual time=176.007..195.494 rows=26,271 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
18. 6.967 141.725 ↑ 2.3 8,757 3 / 3

Partial GroupAggregate (cost=22,905.81..23,467.85 rows=20,438 width=32) (actual time=134.037..141.725 rows=8,757 loops=3)

  • Group Key: w_1.id, s_1.id, sp_1.id, sr_1.id
19. 10.007 134.758 ↑ 1.4 14,623 3 / 3

Sort (cost=22,905.81..22,956.90 rows=20,438 width=32) (actual time=134.019..134.758 rows=14,623 loops=3)

  • Sort Key: w_1.id, s_1.id, sp_1.id, sr_1.id
  • Sort Method: quicksort Memory: 2,093kB
  • Worker 0: Sort Method: quicksort Memory: 1,426kB
  • Worker 1: Sort Method: quicksort Memory: 1,446kB
20. 5.359 124.751 ↑ 1.4 14,623 3 / 3

Parallel Hash Join (cost=11,790.03..21,442.55 rows=20,438 width=32) (actual time=69.513..124.751 rows=14,623 loops=3)

  • Hash Cond: (s_1.registration_id = sr_1.id)
21. 10.423 110.730 ↑ 1.4 14,858 3 / 3

Parallel Hash Left Join (cost=9,729.20..19,326.25 rows=21,135 width=32) (actual time=60.401..110.730 rows=14,858 loops=3)

  • Hash Cond: (ar.id = arv.result_id)
  • Join Filter: (ar.value_by_id IS NOT NULL)
22. 20.042 74.597 ↑ 1.4 14,836 3 / 3

Parallel Hash Join (cost=5,994.67..15,442.66 rows=21,135 width=32) (actual time=33.339..74.597 rows=14,836 loops=3)

  • Hash Cond: (ar.sample_parameter_id = sp_1.id)
23. 21.460 21.460 ↑ 1.3 101,949 3 / 3

Parallel Seq Scan on analytical_results ar (cost=0.00..8,841.85 rows=128,485 width=20) (actual time=0.023..21.460 rows=101,949 loops=3)

24. 3.130 33.095 ↑ 1.9 8,294 3 / 3

Parallel Hash (cost=5,792.98..5,792.98 rows=16,135 width=16) (actual time=33.095..33.095 rows=8,294 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,472kB
25. 1.888 29.965 ↑ 1.9 8,294 3 / 3

Hash Join (cost=857.56..5,792.98 rows=16,135 width=16) (actual time=7.484..29.965 rows=8,294 loops=3)

  • Hash Cond: (sp_1.sample_type_id = st_1.id)
26. 3.948 27.659 ↑ 1.9 8,294 3 / 3

Nested Loop (cost=856.38..5,727.02 rows=16,135 width=20) (actual time=7.050..27.659 rows=8,294 loops=3)

27. 3.478 13.387 ↑ 1.9 2,581 3 / 3

Hash Join (cost=855.96..2,450.92 rows=4,885 width=12) (actual time=7.014..13.387 rows=2,581 loops=3)

  • Hash Cond: (s_1.work_order_id = w_1.id)
28. 2.965 2.965 ↑ 1.8 16,749 3 / 3

Parallel Seq Scan on samples s_1 (cost=0.00..1,516.99 rows=29,699 width=12) (actual time=0.013..2.965 rows=16,749 loops=3)

29. 0.888 6.944 ↓ 1.0 5,455 3 / 3

Hash (cost=789.08..789.08 rows=5,350 width=4) (actual time=6.944..6.944 rows=5,455 loops=3)

  • Buckets: 8,192 Batches: 1 Memory Usage: 256kB
30. 6.056 6.056 ↓ 1.0 5,455 3 / 3

Index Scan using idx_received_at on work_orders w_1 (cost=0.29..789.08 rows=5,350 width=4) (actual time=0.048..6.056 rows=5,455 loops=3)

  • Index Cond: ((received_at >= '2019-12-31 23:59:59'::timestamp without time zone) AND (received_at <= '2020-01-31 23:59:59'::timestamp without time zone))
  • Filter: active
  • Rows Removed by Filter: 55
31. 10.324 10.324 ↑ 2.0 3 7,743 / 3

Index Scan using index_sample_parameters_on_sample_id_and_position on sample_parameters sp_1 (cost=0.42..0.61 rows=6 width=12) (actual time=0.003..0.004 rows=3 loops=7,743)

  • Index Cond: (sample_id = s_1.id)
32. 0.011 0.418 ↑ 1.0 8 3 / 3

Hash (cost=1.08..1.08 rows=8 width=4) (actual time=0.418..0.418 rows=8 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
33. 0.407 0.407 ↑ 1.0 8 3 / 3

Seq Scan on sample_types st_1 (cost=0.00..1.08 rows=8 width=4) (actual time=0.406..0.407 rows=8 loops=3)

34. 16.214 25.710 ↑ 1.8 57,683 3 / 3

Parallel Hash (cost=2,461.46..2,461.46 rows=101,846 width=12) (actual time=25.710..25.710 rows=57,683 loops=3)

  • Buckets: 262,144 Batches: 1 Memory Usage: 10,208kB
35. 9.496 9.496 ↑ 1.8 57,683 3 / 3

Parallel Seq Scan on analytical_result_validations arv (cost=0.00..2,461.46 rows=101,846 width=12) (actual time=0.016..9.496 rows=57,683 loops=3)

36. 4.258 8.662 ↑ 1.8 17,548 3 / 3

Parallel Hash (cost=1,674.01..1,674.01 rows=30,945 width=4) (actual time=8.662..8.662 rows=17,548 loops=3)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,592kB
37. 4.404 4.404 ↓ 1.7 52,645 1 / 3

Parallel Seq Scan on sample_registrations sr_1 (cost=0.00..1,674.01 rows=30,945 width=4) (actual time=0.008..13.211 rows=52,645 loops=1)

  • Filter: active
  • Rows Removed by Filter: 1,764
38. 46.126 115.160 ↑ 1.0 165,632 1

Hash (cost=5,140.50..5,140.50 rows=166,750 width=33) (actual time=115.160..115.160 rows=165,632 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 3,142kB
39. 69.034 69.034 ↑ 1.0 165,632 1

Seq Scan on sample_parameters sp (cost=0.00..5,140.50 rows=166,750 width=33) (actual time=0.017..69.034 rows=165,632 loops=1)

40. 9.618 22.442 ↑ 1.0 50,248 1

Hash (cost=1,724.89..1,724.89 rows=50,489 width=16) (actual time=22.442..22.442 rows=50,248 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,994kB
41. 12.824 12.824 ↑ 1.0 50,248 1

Seq Scan on samples s (cost=0.00..1,724.89 rows=50,489 width=16) (actual time=0.011..12.824 rows=50,248 loops=1)

42. 49.068 49.068 ↑ 1.0 1 24,534

Index Scan using work_orders_pkey on work_orders w (cost=0.29..0.34 rows=1 width=23) (actual time=0.002..0.002 rows=1 loops=24,534)

  • Index Cond: (id = q.work_order_id)
43. 49.068 49.068 ↑ 1.0 1 24,534

Index Scan using sample_registrations_pkey on sample_registrations sr (cost=0.29..0.34 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=24,534)

  • Index Cond: (id = q.sample_registration_id)
44. 0.004 0.014 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=520) (actual time=0.014..0.014 rows=8 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
45. 0.010 0.010 ↑ 1.0 8 1

Seq Scan on sample_types st (cost=0.00..1.08 rows=8 width=520) (actual time=0.008..0.010 rows=8 loops=1)

46. 0.822 1.836 ↑ 1.0 3,990 1

Hash (cost=179.90..179.90 rows=3,990 width=54) (actual time=1.836..1.836 rows=3,990 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 375kB
47. 1.014 1.014 ↑ 1.0 3,990 1

Seq Scan on analytical_parameters ap (cost=0.00..179.90 rows=3,990 width=54) (actual time=0.007..1.014 rows=3,990 loops=1)

48. 0.028 0.205 ↑ 1.0 82 1

Hash (cost=7.41..7.41 rows=82 width=579) (actual time=0.205..0.205 rows=82 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 20kB
49. 0.025 0.177 ↑ 1.0 82 1

Hash Join (cost=5.05..7.41 rows=82 width=579) (actual time=0.133..0.177 rows=82 loops=1)

  • Hash Cond: (fsd.functional_structure_id = fs.id)
50. 0.087 0.115 ↑ 1.0 82 1

Hash Join (cost=1.20..3.34 rows=82 width=524) (actual time=0.090..0.115 rows=82 loops=1)

  • Hash Cond: (fsd.department_id = d.id)
51. 0.013 0.013 ↑ 1.0 82 1

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

52. 0.004 0.015 ↑ 1.0 9 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
53. 0.011 0.011 ↑ 1.0 9 1

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

54. 0.019 0.037 ↑ 1.0 82 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
55. 0.018 0.018 ↑ 1.0 82 1

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

56. 0.073 0.152 ↑ 1.0 339 1

Hash (cost=12.39..12.39 rows=339 width=25) (actual time=0.152..0.152 rows=339 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
57. 0.079 0.079 ↑ 1.0 339 1

Seq Scan on lab_matrices lm (cost=0.00..12.39 rows=339 width=25) (actual time=0.013..0.079 rows=339 loops=1)

58. 0.110 0.218 ↑ 1.0 517 1

Hash (cost=12.17..12.17 rows=517 width=34) (actual time=0.218..0.218 rows=517 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 43kB
59. 0.108 0.108 ↑ 1.0 517 1

Seq Scan on sample_references sre (cost=0.00..12.17 rows=517 width=34) (actual time=0.025..0.108 rows=517 loops=1)

60. 73.602 318.942 ↑ 2.0 1 24,534

Append (cost=0.00..0.31 rows=2 width=56) (actual time=0.013..0.013 rows=1 loops=24,534)

61. 0.000 0.000 ↓ 0.0 0 24,534

Seq Scan on translations estado_req (cost=0.00..0.00 rows=1 width=548) (actual time=0.000..0.000 rows=0 loops=24,534)

  • Filter: (((locale_code)::text = 'pt-PT'::text) AND ((key)::text = ('samples.work-orders.sample-registrations.state.'::text || (w.state)::text)))
62. 245.340 245.340 ↑ 1.0 1 24,534

Index Scan using translations_pt_pt_pk on "translations_pt-PT" estado_req_1 (cost=0.28..0.30 rows=1 width=56) (actual time=0.010..0.010 rows=1 loops=24,534)

  • Index Cond: (((locale_code)::text = 'pt-PT'::text) AND ((key)::text = ('samples.work-orders.sample-registrations.state.'::text || (w.state)::text)))
63. 49.068 269.874 ↑ 2.0 1 24,534

Append (cost=0.00..0.31 rows=2 width=56) (actual time=0.011..0.011 rows=1 loops=24,534)

64. 0.000 0.000 ↓ 0.0 0 24,534

Seq Scan on translations estado_parametro (cost=0.00..0.00 rows=1 width=548) (actual time=0.000..0.000 rows=0 loops=24,534)

  • Filter: (((locale_code)::text = 'pt-PT'::text) AND ((key)::text = ('samples.analytical-results.state.'::text || (sp.state)::text)))
65. 220.806 220.806 ↑ 1.0 1 24,534

Index Scan using translations_pt_pt_pk on "translations_pt-PT" estado_parametro_1 (cost=0.28..0.30 rows=1 width=56) (actual time=0.009..0.009 rows=1 loops=24,534)

  • Index Cond: (((locale_code)::text = 'pt-PT'::text) AND ((key)::text = ('samples.analytical-results.state.'::text || (sp.state)::text)))
66.          

SubPlan (for Nested Loop Left Join)

67. 49.068 220.806 ↑ 1.0 1 24,534

Aggregate (cost=4.50..4.51 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=24,534)

68. 49.068 171.738 ↓ 0.0 0 24,534

Bitmap Heap Scan on analytical_reports report_parametro (cost=3.38..4.49 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=24,534)

  • Recheck Cond: ((sample_id = s.id) AND (work_order_id = w.id))
  • Filter: (sample_parameter_id = sp.id)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=31,844
69. 17.004 122.670 ↓ 0.0 0 24,534

BitmapAnd (cost=3.38..3.38 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=24,534)

70. 73.602 73.602 ↑ 6.0 1 24,534

Bitmap Index Scan on index_analytical_reports_on_sample_id (cost=0.00..1.56 rows=6 width=0) (actual time=0.003..0.003 rows=1 loops=24,534)

  • Index Cond: (sample_id = s.id)
71. 32.064 32.064 ↓ 4.2 25 8,016

Bitmap Index Scan on index_analytical_reports_on_work_order_id_and_preview (cost=0.00..1.56 rows=6 width=0) (actual time=0.004..0.004 rows=25 loops=8,016)

  • Index Cond: (work_order_id = w.id)
72. 0.000 0.000 ↓ 0.0 0

Limit (cost=3.77..3.78 rows=1 width=8) (never executed)

73. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.77..3.78 rows=1 width=8) (never executed)

  • Sort Key: report_parametro_1.created_at
74. 0.000 0.000 ↓ 0.0 0

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_parametro_1 (cost=0.42..3.76 rows=1 width=8) (never executed)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: ((NOT partial) AND (sample_id = s.id) AND (sample_parameter_id = sp.id))
75. 49.068 196.272 ↑ 1.0 1 24,534

Aggregate (cost=4.49..4.50 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=24,534)

76. 49.068 147.204 ↑ 1.0 1 24,534

Bitmap Heap Scan on analytical_reports report_amostra (cost=3.38..4.49 rows=1 width=0) (actual time=0.005..0.006 rows=1 loops=24,534)

  • Recheck Cond: ((sample_id = s.id) AND (work_order_id = w.id))
  • Filter: (sample_parameter_id IS NULL)
  • Heap Blocks: exact=31,844
77. 17.004 98.136 ↓ 0.0 0 24,534

BitmapAnd (cost=3.38..3.38 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=24,534)

78. 49.068 49.068 ↑ 6.0 1 24,534

Bitmap Index Scan on index_analytical_reports_on_sample_id (cost=0.00..1.56 rows=6 width=0) (actual time=0.002..0.002 rows=1 loops=24,534)

  • Index Cond: (sample_id = s.id)
79. 32.064 32.064 ↓ 4.2 25 8,016

Bitmap Index Scan on index_analytical_reports_on_work_order_id_and_preview (cost=0.00..1.56 rows=6 width=0) (actual time=0.004..0.004 rows=25 loops=8,016)

  • Index Cond: (work_order_id = w.id)
80. 8.016 96.192 ↑ 1.0 1 8,016

Limit (cost=3.77..3.77 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=8,016)

81. 16.032 88.176 ↑ 1.0 1 8,016

Sort (cost=3.77..3.77 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=8,016)

  • Sort Key: report_amostra_1.created_at
  • Sort Method: quicksort Memory: 25kB
82. 72.144 72.144 ↑ 1.0 1 8,016

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_amostra_1 (cost=0.42..3.76 rows=1 width=8) (actual time=0.006..0.009 rows=1 loops=8,016)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: ((sample_parameter_id IS NULL) AND (NOT partial) AND (sample_id = s.id))
  • Rows Removed by Filter: 7
83. 16.518 99.108 ↓ 0.0 0 16,518

Limit (cost=3.76..3.77 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=16,518)

84. 16.518 82.590 ↓ 0.0 0 16,518

Sort (cost=3.76..3.77 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=16,518)

  • Sort Key: report_requisicao.created_at
  • Sort Method: quicksort Memory: 25kB
85. 66.072 66.072 ↓ 0.0 0 16,518

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_requisicao (cost=0.42..3.75 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=16,518)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: ((sample_id IS NULL) AND (sample_parameter_id IS NULL) AND (NOT partial))
  • Rows Removed by Filter: 1
86. 49.068 196.272 ↑ 1.0 1 24,534

Aggregate (cost=4.50..4.51 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=24,534)

87. 49.068 147.204 ↓ 0.0 0 24,534

Bitmap Heap Scan on analytical_reports report_parametro_2 (cost=3.38..4.49 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=24,534)

  • Recheck Cond: ((sample_id = s.id) AND (work_order_id = w.id))
  • Filter: (sample_parameter_id = sp.id)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=31,844
88. 17.004 98.136 ↓ 0.0 0 24,534

BitmapAnd (cost=3.38..3.38 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=24,534)

89. 49.068 49.068 ↑ 6.0 1 24,534

Bitmap Index Scan on index_analytical_reports_on_sample_id (cost=0.00..1.56 rows=6 width=0) (actual time=0.002..0.002 rows=1 loops=24,534)

  • Index Cond: (sample_id = s.id)
90. 32.064 32.064 ↓ 4.2 25 8,016

Bitmap Index Scan on index_analytical_reports_on_work_order_id_and_preview (cost=0.00..1.56 rows=6 width=0) (actual time=0.004..0.004 rows=25 loops=8,016)

  • Index Cond: (work_order_id = w.id)
91. 0.000 0.000 ↓ 0.0 0

Limit (cost=3.77..3.78 rows=1 width=8) (never executed)

92. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.77..3.78 rows=1 width=8) (never executed)

  • Sort Key: report_parametro_3.created_at
93. 0.000 0.000 ↓ 0.0 0

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_parametro_3 (cost=0.42..3.76 rows=1 width=8) (never executed)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: (partial AND (sample_id = s.id) AND (sample_parameter_id = sp.id))
94. 73.602 196.272 ↑ 1.0 1 24,534

Aggregate (cost=4.49..4.50 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=24,534)

95. 24.534 122.670 ↑ 1.0 1 24,534

Bitmap Heap Scan on analytical_reports report_amostra_2 (cost=3.38..4.49 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=24,534)

  • Recheck Cond: ((sample_id = s.id) AND (work_order_id = w.id))
  • Filter: (sample_parameter_id IS NULL)
  • Heap Blocks: exact=31,844
96. 17.004 98.136 ↓ 0.0 0 24,534

BitmapAnd (cost=3.38..3.38 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=24,534)

97. 49.068 49.068 ↑ 6.0 1 24,534

Bitmap Index Scan on index_analytical_reports_on_sample_id (cost=0.00..1.56 rows=6 width=0) (actual time=0.002..0.002 rows=1 loops=24,534)

  • Index Cond: (sample_id = s.id)
98. 32.064 32.064 ↓ 4.2 25 8,016

Bitmap Index Scan on index_analytical_reports_on_work_order_id_and_preview (cost=0.00..1.56 rows=6 width=0) (actual time=0.004..0.004 rows=25 loops=8,016)

  • Index Cond: (work_order_id = w.id)
99. 8.016 80.160 ↓ 0.0 0 8,016

Limit (cost=3.77..3.77 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=8,016)

100. 8.016 72.144 ↓ 0.0 0 8,016

Sort (cost=3.77..3.77 rows=1 width=8) (actual time=0.009..0.009 rows=0 loops=8,016)

  • Sort Key: report_amostra_3.created_at
  • Sort Method: quicksort Memory: 25kB
101. 64.128 64.128 ↓ 0.0 0 8,016

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_amostra_3 (cost=0.42..3.76 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=8,016)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: ((sample_parameter_id IS NULL) AND partial AND (sample_id = s.id))
  • Rows Removed by Filter: 7
102. 16.518 82.590 ↓ 0.0 0 16,518

Limit (cost=3.76..3.77 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=16,518)

103. 16.518 66.072 ↓ 0.0 0 16,518

Sort (cost=3.76..3.77 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=16,518)

  • Sort Key: report_requisicao_1.created_at
  • Sort Method: quicksort Memory: 25kB
104. 49.554 49.554 ↑ 1.0 1 16,518

Index Scan using index_analytical_reports_on_work_order_id_and_preview on analytical_reports report_requisicao_1 (cost=0.42..3.75 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=16,518)

  • Index Cond: ((work_order_id = w.id) AND (preview = false))
  • Filter: ((sample_id IS NULL) AND (sample_parameter_id IS NULL) AND partial)
  • Rows Removed by Filter: 0