explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mIhm : Optimization for: plan #Ok2q

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.427 39.398 ↓ 6.1 865 1

Sort (cost=7,380.29..7,380.64 rows=141 width=278) (actual time=39.297..39.398 rows=865 loops=1)

  • Sort Key: kpi_values_by_reports."valuePeriod
  • Sort Method: quicksort Memory: 292kB
2. 6.780 38.971 ↓ 6.1 865 1

Subquery Scan on kpi_values_by_reports (cost=1.22..7,375.26 rows=141 width=278) (actual time=9.731..38.971 rows=865 loops=1)

  • Filter: (kpi_values_by_reports."unscheduledReportId" = ANY ('{1dab9754-d33b-11ea-a1a7-9367627ba996,90174fa0-ca93-11ea-9619-67d9417ae479,b226c19e-5e1d-11ea-add6-bbcb1e36bccc,7805bbc8-5e1d-11ea-a69e-171f047268d9,6ce82558-5e10-11ea-97a8-abbf9f40d01a,2dfd3702-5e10-11ea-9854-83b6f32c65d5,6e1c1c88-5dff-11ea-94fc-9783625d8d2c}'::uuid[]))
  • Rows Removed by Filter: 39,276
3. 10.569 32.191 ↓ 10.0 40,141 1

Unique (cost=1.22..7,299.90 rows=4,019 width=279) (actual time=0.011..32.191 rows=40,141 loops=1)

4. 9.973 21.622 ↑ 1.0 40,187 1

Merge Left Join (cost=1.22..6,797.56 rows=40,187 width=279) (actual time=0.009..21.622 rows=40,187 loops=1)

  • Merge Cond: ("orderedKpiValues"."monitoringReportId" = kmr.id)
5. 11.284 11.284 ↑ 1.0 40,187 1

Index Scan using "kpi_monitoring_report_kpi_val_monitoringReportId_kpiId_type_idx" on kpi_monitoring_report_kpi_value "orderedKpiValues" (cost=0.41..6,175.16 rows=40,187 width=242) (actual time=0.003..11.284 rows=40,187 loops=1)

6. 0.365 0.365 ↑ 1.0 911 1

Index Scan using kpi_monitoring_report_pkey on kpi_monitoring_report kmr (cost=0.28..117.79 rows=911 width=52) (actual time=0.003..0.365 rows=911 loops=1)

Planning time : 0.407 ms
Execution time : 39.465 ms