explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZdLX

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 0.046 ↓ 0.0 0 1

Sort (cost=24.65..24.65 rows=1 width=104) (actual time=0.046..0.046 rows=0 loops=1)

  • Sort Key: (((sum(materialisedview.enrollments) / mt.total) * '100'::numeric)) DESC
  • Sort Method: quicksort Memory: 25kB
2.          

CTE metricstoal

3. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.19..8.20 rows=1 width=32) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Index Scan using ocpppcv_planpage_idx_2_month on orgunit_customer_product_payer_plan_channel_month_view materialisedview_1 (cost=0.14..8.18 rows=1 width=32) (never executed)

  • Index Cond: ((sales_force_id = 1) AND (orgunit_id = 174) AND (customer_id = 3))
  • Filter: (((year = 2,019) AND (month = ANY ('{1,2,3,4,5,6,7}'::integer[]))) OR ((year = 2,018) AND (month = ANY ('{8,9,10,11,12}'::integer[]))))
5. 0.001 0.031 ↓ 0.0 0 1

GroupAggregate (cost=16.41..16.44 rows=1 width=104) (actual time=0.031..0.031 rows=0 loops=1)

  • Group Key: materialisedview.channel_id, mt.total, ch.channelname
6. 0.018 0.030 ↓ 0.0 0 1

Sort (cost=16.41..16.41 rows=1 width=104) (actual time=0.030..0.030 rows=0 loops=1)

  • Sort Key: materialisedview.channel_id, mt.total, ch.channelname
  • Sort Method: quicksort Memory: 25kB
7. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.29..16.40 rows=1 width=104) (actual time=0.012..0.012 rows=0 loops=1)

8. 0.001 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.29..16.37 rows=1 width=72) (actual time=0.012..0.012 rows=0 loops=1)

9. 0.011 0.011 ↓ 0.0 0 1

Index Scan using ocpppcv_planpage_idx_2_month on orgunit_customer_product_payer_plan_channel_month_view materialisedview (cost=0.14..8.18 rows=1 width=40) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: ((sales_force_id = 1) AND (orgunit_id = 174) AND (customer_id = 3))
  • Filter: (((year = 2,019) AND (month = ANY ('{1,2,3,4,5,6,7}'::integer[]))) OR ((year = 2,018) AND (month = ANY ('{8,9,10,11,12}'::integer[]))))
10. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_channel_channelid on channel ch (cost=0.15..8.17 rows=1 width=40) (never executed)

  • Index Cond: (channelid = materialisedview.channel_id)
  • Filter: (isdeleted = 0)
11. 0.000 0.000 ↓ 0.0 0

CTE Scan on metricstoal mt (cost=0.00..0.02 rows=1 width=32) (never executed)

Planning time : 1.601 ms
Execution time : 0.165 ms