explain.depesz.com

PostgreSQL's explain analyze made readable

Result: A25w

Settings
# exclusive inclusive rows x rows loops node
1. 0.063 0.063 ↑ 1.0 1 1

CTE Scan on attributegrain (cost=34.92..34.94 rows=1 width=541) (actual time=0.060..0.063 rows=1 loops=1)

2.          

CTE config

3. 0.004 0.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.44..25.63 rows=1 width=507) (actual time=0.035..0.037 rows=1 loops=1)

  • Join Filter: (at.datasourceid = ds.datasourceid)
  • Rows Removed by Join Filter: 6
4. 0.001 0.026 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.44..24.53 rows=1 width=507) (actual time=0.025..0.026 rows=1 loops=1)

5. 0.001 0.023 ↑ 1.0 1 1

Nested Loop (cost=0.29..16.35 rows=1 width=493) (actual time=0.022..0.023 rows=1 loops=1)

  • Join Filter: (at.entitycombinationid = ec.entityvalue)
6. 0.014 0.014 ↑ 1.0 1 1

Index Scan using attributetype_name_idx on attributetype at (cost=0.14..8.16 rows=1 width=397) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (name = 'nps'::text)
  • Filter: (isdeleted = 0)
7. 0.008 0.008 ↑ 1.0 1 1

Index Scan using entitycombination_entitykey_key on entitycombination ec (cost=0.15..8.17 rows=1 width=98) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (entitykey = 'METRIC_NUM_ORGUNIT_CUST_PROD_PLAN_CHANNEL'::text)
8. 0.002 0.002 ↓ 0.0 0 1

Index Scan using unique_key_attributecolumnmapping on attributecolumnmapping acm (cost=0.15..8.17 rows=1 width=22) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (attributetypeid = at.attributetypeid)
  • Filter: ((salesforceid = 1) AND (isdeleted = 0))
9. 0.007 0.007 ↓ 7.0 7 1

Seq Scan on datasource ds (cost=0.00..1.09 rows=1 width=12) (actual time=0.006..0.007 rows=7 loops=1)

  • Filter: (isdeleted = 0)
10.          

CTE attributegrain

11. 0.003 0.061 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.24..9.29 rows=1 width=541) (actual time=0.058..0.061 rows=1 loops=1)

12.          

Initplan (for Nested Loop Left Join)

13. 0.000 0.016 ↑ 1.0 1 1

Limit (cost=1.08..1.09 rows=1 width=12) (actual time=0.016..0.016 rows=1 loops=1)

14. 0.011 0.016 ↑ 1.0 1 1

Sort (cost=1.08..1.09 rows=1 width=12) (actual time=0.016..0.016 rows=1 loops=1)

  • Sort Key: grain.grainnumber DESC
  • Sort Method: top-N heapsort Memory: 25kB
15. 0.005 0.005 ↓ 3.0 3 1

Seq Scan on grain (cost=0.00..1.07 rows=1 width=12) (actual time=0.004..0.005 rows=3 loops=1)

  • Filter: ((grainnumber <= 15) AND (isdeleted = 0))
  • Rows Removed by Filter: 2
16. 0.039 0.039 ↑ 1.0 1 1

CTE Scan on config (cost=0.00..0.02 rows=1 width=533) (actual time=0.037..0.039 rows=1 loops=1)

17. 0.003 0.003 ↓ 0.0 0 1

Index Scan using unique_grain_id_attribute_type_id on attributetypegrainmapping agm (cost=0.15..8.17 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((grainid = $2) AND (attributetypeid = config.id))
  • Filter: (isdeleted = 0)
Planning time : 0.539 ms
Execution time : 0.134 ms