explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XKMa

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

Limit (cost=2,337,347.55..2,337,372.55 rows=10,000 width=1,048) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=2,337,347.55..2,340,760.06 rows=1,365,004 width=1,048) (actual rows= loops=)

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

Hash Join (cost=4,873.07..322,698.41 rows=1,365,004 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=631.37..317,247.11 rows=451,241 width=1,016) (actual rows= loops=)

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

Hash Join (cost=605.55..311,016.72 rows=451,241 width=1,012) (actual rows= loops=)

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

Append (cost=435.70..305,147.82 rows=451,241 width=1,530) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=435.70..294,463.20 rows=441,715 width=411) (actual rows= loops=)

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

Hash Left Join (cost=408.90..177,984.43 rows=441,715 width=371) (actual rows= loops=)

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

Hash Left Join (cost=382.10..171,884.05 rows=441,715 width=367) (actual rows= loops=)

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

Hash Left Join (cost=355.30..170,200.81 rows=441,715 width=355) (actual rows= loops=)

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

Hash Join (cost=180.59..168,864.50 rows=441,715 width=279) (actual rows= loops=)

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

Seq Scan on kx_kq_store ks (cost=0.00..167,480.83 rows=457,491 width=279) (actual rows= loops=)

  • Filter: ((platstatus = 1) AND (status = 1) AND (id <> ALL ('{1162179869904343040,1163282069900627968,1163364093453799424,1168429282108772352,1162179523995897856,1177535785453359104,1182169529795612672,1164352974915506176,1163714177286672384,1176030923402121216,1163348996463398912,1170935209152090112,1163389023922819072,1190522765631950848,1181840166625611776,1163353196333240320,1169808006297292800,1181840407869394944,1169807612389232640,1161100808092258304,1161452280499802112,1162180686644383744,1162193076198969344,1161126219564060672,1161447945745338368,1163386850338017280,1167374220104175616,1163341253593665536,1182581431776448512,1160832668166918144,1163348491360145408,1163352674775732224,1163352833286868992,1163350820188721152,1163376230142185472,1170892470632976384,1184351942797824000,1174606106123702272,1169468814799278080,1163357347314274304,1174605981137637376,1181811386456608794,1189904379570950144}'::bigint[])))
13. 0.000 0.000 ↓ 0.0

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

14. 0.000 0.000 ↓ 0.0

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

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

Hash (cost=146.36..146.36 rows=2,268 width=84) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

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

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

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

18. 0.000 0.000 ↓ 0.0

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

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

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

20. 0.000 0.000 ↓ 0.0

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

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

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

22. 0.000 0.000 ↓ 0.0

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

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

Hash Left Join (cost=382.10..6,160.14 rows=9,525 width=441) (actual rows= loops=)

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

Hash Left Join (cost=355.30..3,621.12 rows=9,525 width=331) (actual rows= loops=)

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

Hash Join (cost=180.59..3,421.36 rows=9,525 width=255) (actual rows= loops=)

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

Seq Scan on ka_kq_channelcustomers kc_1 (cost=0.00..3,214.84 rows=9,865 width=255) (actual rows= loops=)

  • Filter: (((tn_isdistributor = 0) OR (tn_isdistributor IS NULL)) AND (platstatus = 1) AND (status = 1) AND (id <> ALL ('{1162179869904343040,1163282069900627968,1163364093453799424,1168429282108772352,1162179523995897856,1177535785453359104,1182169529795612672,1164352974915506176,1163714177286672384,1176030923402121216,1163348996463398912,1170935209152090112,1163389023922819072,1190522765631950848,1181840166625611776,1163353196333240320,1169808006297292800,1181840407869394944,1169807612389232640,1161100808092258304,1161452280499802112,1162180686644383744,1162193076198969344,1161126219564060672,1161447945745338368,1163386850338017280,1167374220104175616,1163341253593665536,1182581431776448512,1160832668166918144,1163348491360145408,1163352674775732224,1163352833286868992,1163350820188721152,1163376230142185472,1170892470632976384,1184351942797824000,1174606106123702272,1169468814799278080,1163357347314274304,1174605981137637376,1181811386456608794,1189904379570950144}'::bigint[])))
27. 0.000 0.000 ↓ 0.0

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

28. 0.000 0.000 ↓ 0.0

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

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

Hash (cost=146.36..146.36 rows=2,268 width=84) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

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

  • Filter: (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 pd1_1 (cost=0.00..21.90 rows=392 width=20) (actual rows= loops=)

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

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

34. 0.000 0.000 ↓ 0.0

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

  • Filter: ((platstatus = 1) AND (status = 1) AND (id <> ALL ('{1162179869904343040,1163282069900627968,1163364093453799424,1168429282108772352,1162179523995897856,1177535785453359104,1182169529795612672,1164352974915506176,1163714177286672384,1176030923402121216,1163348996463398912,1170935209152090112,1163389023922819072,1190522765631950848,1181840166625611776,1163353196333240320,1169808006297292800,1181840407869394944,1169807612389232640,1161100808092258304,1161452280499802112,1162180686644383744,1162193076198969344,1161126219564060672,1161447945745338368,1163386850338017280,1167374220104175616,1163341253593665536,1182581431776448512,1160832668166918144,1163348491360145408,1163352674775732224,1163352833286868992,1163350820188721152,1163376230142185472,1170892470632976384,1184351942797824000,1174606106123702272,1169468814799278080,1163357347314274304,1174605981137637376,1181811386456608794,1189904379570950144}'::bigint[])))
35. 0.000 0.000 ↓ 0.0

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

36. 0.000 0.000 ↓ 0.0

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

37. 0.000 0.000 ↓ 0.0

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

38. 0.000 0.000 ↓ 0.0

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

39. 0.000 0.000 ↓ 0.0

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

40. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,222.04..4,228.09 rows=605 width=8) (actual rows= loops=)

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

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

42. 0.000 0.000 ↓ 0.0

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

  • Recheck Cond: (representativeid = '1160102352791932928'::bigint)
  • Filter: (platstatus = 1)
43. 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 = '1160102352791932928'::bigint)
44. 0.000 0.000 ↓ 0.0

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

45. 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 = '1160102352791932928'::bigint))
46. 0.000 0.000 ↓ 0.0

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

  • Recheck Cond: (representativeid = m.orgstructid)
  • Filter: (platstatus = 1)
47. 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)
48. 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 = '1160102352791932928'::bigint)
  • Filter: (platstatus = 1)
49. 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 = '1160102352791932928'::bigint)
50. 0.000 0.000 ↓ 0.0

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

51. 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 = '1160102352791932928'::bigint))
52. 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)
53. 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)