explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F1Dt

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 2,459.393 ↓ 24.0 24 1

Group (cost=1,340.10..1,340.11 rows=1 width=8) (actual time=2,459.380..2,459.393 rows=24 loops=1)

  • Group Key: cs.customerid
2. 0.037 2,459.383 ↓ 77.0 77 1

Sort (cost=1,340.10..1,340.11 rows=1 width=8) (actual time=2,459.376..2,459.383 rows=77 loops=1)

  • Sort Key: cs.customerid
  • Sort Method: quicksort Memory: 28kB
3. 0.000 2,459.346 ↓ 77.0 77 1

Nested Loop (cost=1.85..1,340.09 rows=1 width=8) (actual time=2,432.489..2,459.346 rows=77 loops=1)

4. 0.000 2,455.765 ↓ 1,273.0 1,273 1

Nested Loop (cost=1.42..1,339.57 rows=1 width=24) (actual time=2,432.470..2,455.765 rows=1,273 loops=1)

5. 126.539 657.737 ↓ 20,759.1 996,439 1

Nested Loop (cost=0.99..1,316.82 rows=48 width=16) (actual time=0.080..657.737 rows=996,439 loops=1)

  • Join Filter: (it.entitytypeid = ia.entitytypeid)
6. 1.061 4.233 ↓ 9,245.0 9,245 1

Nested Loop (cost=0.43..9.55 rows=1 width=16) (actual time=0.035..4.233 rows=9,245 loops=1)

7. 0.009 0.009 ↑ 1.0 1 1

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

  • Filter: ((isdeleted = 0) AND (type = 'customer'::text))
  • Rows Removed by Filter: 4
8. 3.163 3.163 ↓ 9,245.0 9,245 1

Index Scan using customersegment_productid_idx on customersegment cs (cost=0.43..8.45 rows=1 width=8) (actual time=0.025..3.163 rows=9,245 loops=1)

  • Index Cond: (productid IS NULL)
  • Filter: (isdeleted = 0)
9. 526.965 526.965 ↑ 6.8 108 9,245

Index Scan using insightassociations_entityid_idx on insightassociations ia (cost=0.56..1,298.13 rows=731 width=24) (actual time=0.006..0.057 rows=108 loops=9,245)

  • Index Cond: (entityid = cs.customerid)
  • Filter: (isdeleted = 0)
10. 1,992.878 1,992.878 ↓ 0.0 0 996,439

Index Scan using userinsightpreference_userid_insightid_unique on userinsightpreference uip (cost=0.43..0.46 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=996,439)

  • Index Cond: ((userid = 9,046) AND (insightid = ia.insightid))
  • Filter: (status = 0)
  • Rows Removed by Filter: 0
11. 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.002..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