explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VTYE

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 14.673 ↓ 24.0 24 1

Group (cost=7,318.14..7,318.15 rows=1 width=8) (actual time=14.660..14.673 rows=24 loops=1)

  • Group Key: c.customerid
2. 0.031 14.667 ↓ 77.0 77 1

Sort (cost=7,318.14..7,318.15 rows=1 width=8) (actual time=14.660..14.667 rows=77 loops=1)

  • Sort Key: c.customerid
  • Sort Method: quicksort Memory: 28kB
3. 0.000 14.636 ↓ 77.0 77 1

Nested Loop (cost=14.82..7,318.13 rows=1 width=8) (actual time=0.832..14.636 rows=77 loops=1)

4. 0.620 10.922 ↓ 1,273.0 1,273 1

Nested Loop (cost=14.39..7,317.61 rows=1 width=24) (actual time=0.225..10.922 rows=1,273 loops=1)

  • Join Filter: (cs.customerid = c.customerid)
5. 1.115 7.756 ↓ 1,273.0 1,273 1

Nested Loop (cost=13.96..7,317.14 rows=1 width=32) (actual time=0.214..7.756 rows=1,273 loops=1)

6. 0.124 4.315 ↓ 2.8 1,163 1

Nested Loop (cost=13.53..7,117.73 rows=422 width=24) (actual time=0.201..4.315 rows=1,163 loops=1)

7. 0.011 0.011 ↑ 1.0 1 1

Seq Scan on entitytypes it (cost=0.00..1.09 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=1)

  • Filter: ((isdeleted = 0) AND (type = 'customer'::text))
  • Rows Removed by Filter: 4
8. 0.582 4.180 ↓ 2.0 1,163 1

Nested Loop (cost=13.53..7,110.78 rows=586 width=32) (actual time=0.189..4.180 rows=1,163 loops=1)

9. 0.663 0.773 ↑ 1.0 565 1

Bitmap Heap Scan on userinsightpreference uip (cost=12.97..2,075.57 rows=586 width=8) (actual time=0.174..0.773 rows=565 loops=1)

  • Recheck Cond: (userid = 9,046)
  • Filter: (status = 0)
  • Rows Removed by Filter: 35
  • Heap Blocks: exact=566
10. 0.110 0.110 ↓ 1.0 600 1

Bitmap Index Scan on userinsightpreference_userid_idx (cost=0.00..12.82 rows=586 width=0) (actual time=0.110..0.110 rows=600 loops=1)

  • Index Cond: (userid = 9,046)
11. 2.825 2.825 ↓ 2.0 2 565

Index Scan using unique_insightid_entitytype_and_entityid on insightassociations ia (cost=0.56..8.58 rows=1 width=24) (actual time=0.005..0.005 rows=2 loops=565)

  • Index Cond: ((insightid = uip.insightid) AND (entitytypeid = it.entitytypeid))
  • Filter: (isdeleted = 0)
12. 2.326 2.326 ↑ 1.0 1 1,163

Index Only Scan using customersegment_customerid_isdeleted_productid_idx on customersegment cs (cost=0.43..0.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,163)

  • Index Cond: ((customerid = ia.entityid) AND (isdeleted = 0) AND (productid IS NULL))
  • Heap Fetches: 1,273
13. 2.546 2.546 ↑ 1.0 1 1,273

Index Only Scan using pk_customers_customerid on customers c (cost=0.43..0.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,273)

  • Index Cond: (customerid = ia.entityid)
  • Heap Fetches: 1,273
14. 3.819 3.819 ↓ 0.0 0 1,273

Index Scan using pk_insights_insightid on insights i (cost=0.43..0.51 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1,273)

  • Index Cond: (insightid = ia.insightid)
  • Filter: ((isdeleted = 0) AND (insighttype = 1) AND (expirydate >= now()))
  • Rows Removed by Filter: 1