explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VfWH

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=2,329,807.16..2,329,832.16 rows=10,000 width=1,048) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=2,329,807.16..2,333,219.92 rows=1,365,104 width=1,048) (actual rows= loops=)

  • Sort Key: ks.storename
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,696.50..315,010.61 rows=1,365,104 width=1,048) (actual rows= loops=)

  • Hash Cond: (ks.id = kx_kq_storerepresentative.storeid)
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=454.70..309,559.11 rows=451,274 width=1,016) (actual rows= loops=)

  • Hash Cond: (ks.customertype = kc.dickey)
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=427.90..303,327.30 rows=451,274 width=1,012) (actual rows= loops=)

  • Hash Cond: (ks.seleareaid = pl.orgstructid)
6. 0.000 0.000 ↓ 0.0

Append (cost=247.31..297,243.69 rows=467,391 width=1,586) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=247.31..286,742.83 rows=457,508 width=443) (actual rows= loops=)

  • Hash Cond: (ks.storelevel = pd3.dickey)
8. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=221.49..166,101.43 rows=457,508 width=395) (actual rows= loops=)

  • Hash Cond: (ks.storetype = pd2.dickey)
9. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=195.67..159,784.88 rows=457,508 width=391) (actual rows= loops=)

  • Hash Cond: (ks.channeltype = pd1.dickey)
10. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=169.85..158,043.39 rows=457,508 width=379) (actual rows= loops=)

  • Hash Cond: (ks.seleareaid = ps.orgstructid)
11. 0.000 0.000 ↓ 0.0

Seq Scan on kx_kq_store ks (cost=0.00..156,670.41 rows=457,508 width=303) (actual rows= loops=)

  • Filter: ((status = 1) AND (platstatus = 1) AND (id <> ALL ('{1161912835371044881,1182531690522873856,1168807654454333440,1177818989821300736,1163289299471437824,1168437298224828416,1161912835371044866,1161451705347477508,1174210174454468608,1157081416043991242,1158209081685709402,1173754833304424448,1173755455080632320,1158209081685709264,1174150984251871232,1183656922600050688,1174209771021144064,1182470270896705536,1173797110949220352,1173796290677575680,1173796663337291776,1158209081685709226,1158209081685709228,1182544720631566336,1163365971491164160}'::bigint[])))
12. 0.000 0.000 ↓ 0.0

Hash (cost=140.49..140.49 rows=2,349 width=84) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on pl_orgstruct ps (cost=0.00..140.49 rows=2,349 width=84) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=20.92..20.92 rows=392 width=20) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on pl_dictionary pd1 (cost=0.00..20.92 rows=392 width=20) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=20.92..20.92 rows=392 width=20) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on pl_dictionary pd2 (cost=0.00..20.92 rows=392 width=20) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=20.92..20.92 rows=392 width=20) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Seq Scan on pl_dictionary pd3 (cost=0.00..20.92 rows=392 width=20) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=195.67..5,815.56 rows=9,882 width=497) (actual rows= loops=)

  • Hash Cond: (kc_1.channelcustomersort = pd1_1.dickey)
21. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=169.85..3,183.36 rows=9,882 width=331) (actual rows= loops=)

  • Hash Cond: (kc_1.saleareaid = ps_1.orgstructid)
22. 0.000 0.000 ↓ 0.0

Seq Scan on ka_kq_channelcustomers kc_1 (cost=0.00..2,987.52 rows=9,882 width=255) (actual rows= loops=)

  • Filter: (((tn_isdistributor = 0) OR (tn_isdistributor IS NULL)) AND (status = 1) AND (platstatus = 1) AND (id <> ALL ('{1161912835371044881,1182531690522873856,1168807654454333440,1177818989821300736,1163289299471437824,1168437298224828416,1161912835371044866,1161451705347477508,1174210174454468608,1157081416043991242,1158209081685709402,1173754833304424448,1173755455080632320,1158209081685709264,1174150984251871232,1183656922600050688,1174209771021144064,1182470270896705536,1173797110949220352,1173796290677575680,1173796663337291776,1158209081685709226,1158209081685709228,1182544720631566336,1163365971491164160}'::bigint[])))
23. 0.000 0.000 ↓ 0.0

Hash (cost=140.49..140.49 rows=2,349 width=84) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on pl_orgstruct ps_1 (cost=0.00..140.49 rows=2,349 width=84) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Hash (cost=20.92..20.92 rows=392 width=20) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Seq Scan on pl_dictionary pd1_1 (cost=0.00..20.92 rows=392 width=20) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=0.00..11.40 rows=1 width=1,972) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on kx_kq_ka ka (cost=0.00..11.39 rows=1 width=1,968) (actual rows= loops=)

  • Filter: ((status = 1) AND (platstatus = 1) AND (id <> ALL ('{1161912835371044881,1182531690522873856,1168807654454333440,1177818989821300736,1163289299471437824,1168437298224828416,1161912835371044866,1161451705347477508,1174210174454468608,1157081416043991242,1158209081685709402,1173754833304424448,1173755455080632320,1158209081685709264,1174150984251871232,1183656922600050688,1174209771021144064,1182470270896705536,1173797110949220352,1173796290677575680,1173796663337291776,1158209081685709226,1158209081685709228,1182544720631566336,1163365971491164160}'::bigint[])))
29. 0.000 0.000 ↓ 0.0

Hash (cost=152.24..152.24 rows=2,268 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on pl_orgstruct pl (cost=0.00..152.24 rows=2,268 width=8) (actual rows= loops=)

  • Filter: (((codepath)::text ~~ '1.%'::text) AND (platstatus = 1))
31. 0.000 0.000 ↓ 0.0

Hash (cost=21.90..21.90 rows=392 width=20) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Seq Scan on pl_dictionary kc (cost=0.00..21.90 rows=392 width=20) (actual rows= loops=)

  • Filter: (platstatus = 1)
33. 0.000 0.000 ↓ 0.0

Hash (cost=4,234.24..4,234.24 rows=605 width=8) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,222.14..4,228.19 rows=605 width=8) (actual rows= loops=)

  • Group Key: kx_kq_storerepresentative.storeid
35. 0.000 0.000 ↓ 0.0

Append (cost=16.47..4,220.63 rows=605 width=8) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on kx_kq_storerepresentative (cost=16.47..1,694.18 rows=416 width=8) (actual rows= loops=)

  • Recheck Cond: (representativeid = '1160082012585988096'::bigint)
  • Filter: (platstatus = 1)
37. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_kq_storerepresentative_representativeid (cost=0.00..16.36 rows=525 width=0) (actual rows= loops=)

  • Index Cond: (representativeid = '1160082012585988096'::bigint)
38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17.52..2,219.00 rows=177 width=8) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Seq Scan on pl_orgstruct m (cost=0.00..152.24 rows=1 width=8) (actual rows= loops=)

  • Filter: ((platstatus = 1) AND (parentmemberid = '1160082012585988096'::bigint))
40. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on kx_kq_storerepresentative ks_1 (cost=17.52..2,061.52 rows=524 width=16) (actual rows= loops=)

  • Recheck Cond: (representativeid = m.orgstructid)
  • Filter: (platstatus = 1)
41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_kq_storerepresentative_representativeid (cost=0.00..17.39 rows=662 width=0) (actual rows= loops=)

  • Index Cond: (representativeid = m.orgstructid)
42. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on kx_kq_channelmanager (cost=4.35..35.44 rows=8 width=8) (actual rows= loops=)

  • Recheck Cond: (managerid = '1160082012585988096'::bigint)
  • Filter: (platstatus = 1)
43. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_kq_channelmanager_managerid (cost=0.00..4.35 rows=9 width=0) (actual rows= loops=)

  • Index Cond: (managerid = '1160082012585988096'::bigint)
44. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.59..265.96 rows=4 width=8) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on pl_orgstruct m_1 (cost=0.00..152.24 rows=1 width=8) (actual rows= loops=)

  • Filter: ((platstatus = 1) AND (parentmemberid = '1160082012585988096'::bigint))
46. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on kx_kq_channelmanager kt (cost=4.59..113.36 rows=37 width=16) (actual rows= loops=)

  • Recheck Cond: (managerid = m_1.orgstructid)
  • Filter: (platstatus = 1)
47. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_kq_channelmanager_managerid (cost=0.00..4.58 rows=40 width=0) (actual rows= loops=)

  • Index Cond: (managerid = m_1.orgstructid)