explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dqU7

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 11.146 ↓ 10.0 10 1

Limit (cost=2,298.92..2,298.94 rows=1 width=475) (actual time=11.135..11.146 rows=10 loops=1)

2. 0.006 11.140 ↓ 10.0 10 1

Subquery Scan on temp (cost=2,298.92..2,298.94 rows=1 width=475) (actual time=11.134..11.140 rows=10 loops=1)

  • Filter: (temp.rowrank = 1)
  • Rows Removed by Filter: 13
3. 0.200 11.134 ↓ 23.0 23 1

Sort (cost=2,298.92..2,298.92 rows=1 width=475) (actual time=11.133..11.134 rows=23 loops=1)

  • Sort Key: uipriority.prioritisedscore DESC
  • Sort Method: quicksort Memory: 153kB
4. 0.152 10.934 ↓ 250.0 250 1

WindowAgg (cost=2,298.89..2,298.91 rows=1 width=475) (actual time=10.776..10.934 rows=250 loops=1)

5. 0.265 10.782 ↓ 250.0 250 1

Sort (cost=2,298.89..2,298.89 rows=1 width=463) (actual time=10.770..10.782 rows=250 loops=1)

  • Sort Key: c.customerid, uipriority.prioritisedscore DESC
  • Sort Method: quicksort Memory: 153kB
6. 0.106 10.517 ↓ 250.0 250 1

Nested Loop Left Join (cost=925.70..2,298.88 rows=1 width=463) (actual time=1.091..10.517 rows=250 loops=1)

7. 0.181 10.161 ↓ 250.0 250 1

Nested Loop Left Join (cost=925.55..2,298.61 rows=1 width=467) (actual time=1.084..10.161 rows=250 loops=1)

8. 0.219 9.230 ↓ 250.0 250 1

Nested Loop (cost=925.13..2,298.02 rows=1 width=459) (actual time=1.072..9.230 rows=250 loops=1)

  • Join Filter: (c.customertypeid = ct.customertypeid)
9. 0.067 9.011 ↓ 250.0 250 1

Nested Loop (cost=925.13..2,296.97 rows=1 width=435) (actual time=1.064..9.011 rows=250 loops=1)

  • Join Filter: (ia.entitytypeid = et.entitytypeid)
10. 0.094 8.694 ↓ 250.0 250 1

Nested Loop (cost=925.13..2,295.94 rows=1 width=443) (actual time=1.051..8.694 rows=250 loops=1)

11. 0.125 7.850 ↓ 250.0 250 1

Nested Loop (cost=924.72..2,295.21 rows=1 width=146) (actual time=1.041..7.850 rows=250 loops=1)

12. 0.259 6.725 ↓ 250.0 500 1

Nested Loop (cost=924.30..2,294.20 rows=2 width=154) (actual time=1.028..6.725 rows=500 loops=1)

13. 0.272 5.716 ↓ 250.0 250 1

Nested Loop (cost=923.88..2,293.53 rows=1 width=130) (actual time=1.016..5.716 rows=250 loops=1)

  • Join Filter: (uipriority.insightid = insights.insightid)
14. 0.192 3.644 ↓ 150.0 600 1

Nested Loop (cost=923.46..2,290.16 rows=4 width=58) (actual time=0.851..3.644 rows=600 loops=1)

15. 0.151 1.652 ↓ 150.0 600 1

Hash Join (cost=923.05..2,264.52 rows=4 width=34) (actual time=0.840..1.652 rows=600 loops=1)

  • Hash Cond: (uipriority.insightid = uipreference.insightid)
16. 0.723 0.852 ↑ 1.1 610 1

Bitmap Heap Scan on userinsightpriority uipriority (cost=21.49..1,361.24 rows=654 width=21) (actual time=0.183..0.852 rows=610 loops=1)

  • Recheck Cond: (userid = 1,243)
  • Filter: (isdeleted = 0)
  • Heap Blocks: exact=489
17. 0.129 0.129 ↑ 1.1 610 1

Bitmap Index Scan on userinsightpriority_userid_idx (cost=0.00..21.32 rows=654 width=0) (actual time=0.129..0.129 rows=610 loops=1)

  • Index Cond: (userid = 1,243)
18. 0.082 0.649 ↑ 1.0 600 1

Hash (cost=893.92..893.92 rows=611 width=13) (actual time=0.649..0.649 rows=600 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
19. 0.509 0.567 ↑ 1.0 600 1

Bitmap Heap Scan on userinsightpreference uipreference (cost=21.22..893.92 rows=611 width=13) (actual time=0.099..0.567 rows=600 loops=1)

  • Recheck Cond: (userid = 1,243)
  • Filter: (status = 0)
  • Rows Removed by Filter: 10
  • Heap Blocks: exact=415
20. 0.058 0.058 ↑ 1.0 613 1

Bitmap Index Scan on userinsightpreference_userid_insightid_idx (cost=0.00..21.07 rows=620 width=0) (actual time=0.058..0.058 rows=613 loops=1)

  • Index Cond: (userid = 1,243)
21. 1.800 1.800 ↑ 1.0 1 600

Index Scan using insightassociations_insightid_idx on insightassociations ia (cost=0.42..6.40 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=600)

  • Index Cond: (insightid = uipriority.insightid)
  • Filter: (isdeleted = 0)
22. 1.800 1.800 ↓ 0.0 0 600

Index Scan using pk_insights_insightid on insights (cost=0.42..0.83 rows=1 width=96) (actual time=0.003..0.003 rows=0 loops=600)

  • Index Cond: (insightid = ia.insightid)
  • Filter: ((isdeleted = 0) AND (insighttype = 1) AND (expirydate >= CURRENT_TIMESTAMP))
  • Rows Removed by Filter: 1
23. 0.750 0.750 ↑ 1.0 2 250

Index Scan using alignments_customerid_idx on alignments a (cost=0.42..0.65 rows=2 width=24) (actual time=0.002..0.003 rows=2 loops=250)

  • Index Cond: (customerid = ia.entityid)
24. 1.000 1.000 ↓ 0.0 0 500

Index Only Scan using oisocv_userid_salesforceid_orgunitid_idx on orgunitidsfromuserspanofcontrol_view y (cost=0.42..0.49 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=500)

  • Index Cond: ((userid = 1,243) AND (salesforceid = a.salesforceid) AND (orgunitid = a.orgunitid))
  • Heap Fetches: 250
25. 0.750 0.750 ↑ 1.0 1 250

Index Scan using pk_customers_customerid on customers c (cost=0.42..0.73 rows=1 width=313) (actual time=0.003..0.003 rows=1 loops=250)

  • Index Cond: (customerid = ia.entityid)
  • Filter: (isdeleted = 0)
26. 0.250 0.250 ↑ 1.0 1 250

Seq Scan on entitytypes et (cost=0.00..1.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=250)

  • Filter: ((isdeleted = 0) AND (lower(type) = 'customer'::text))
27. 0.000 0.000 ↑ 1.0 1 250

Seq Scan on customertype ct (cost=0.00..1.04 rows=1 width=40) (actual time=0.000..0.000 rows=1 loops=250)

  • Filter: (isdeleted = 0)
28. 0.750 0.750 ↑ 1.0 1 250

Index Scan using customersegment_customerid_isdeleted_productid_idx on customersegment cs (cost=0.41..0.58 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=250)

  • Index Cond: ((c.customerid = customerid) AND (isdeleted = 0) AND (productid IS NULL))
29. 0.250 0.250 ↓ 0.0 0 250

Index Scan using highvaluehcpconfiguration_segmentvalueid_idx on highvaluehcpconfiguration (cost=0.15..0.25 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=250)

  • Index Cond: (cs.segmentvalueid = segmentvalueid)
  • Filter: (isdeleted = 0)
Planning time : 66.305 ms
Execution time : 11.368 ms