explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UKfQ

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

Limit (cost=265,428.32..265,430.52 rows=880 width=996) (actual rows= loops=)

  • Output: ml.customerid, ml.customername, ml.ctype, ml.customerlevel, ml.address, ml.customerstatus, ml.plandate, ml.userid, ml.customertype, ml.seq, ml.actualvisittime, ml.visittype, ml.status, ml.isplan, ((ml.seq + 0))
2. 0.000 0.000 ↓ 0.0

Sort (cost=265,428.32..265,430.52 rows=880 width=996) (actual rows= loops=)

  • Output: ml.customerid, ml.customername, ml.ctype, ml.customerlevel, ml.address, ml.customerstatus, ml.plandate, ml.userid, ml.customertype, ml.seq, ml.actualvisittime, ml.visittype, ml.status, ml.isplan, ((ml.seq + 0))
  • Sort Key: ((ml.seq + 0)), ml.customername
3. 0.000 0.000 ↓ 0.0

Subquery Scan on ml (cost=265,365.48..265,385.28 rows=880 width=996) (actual rows= loops=)

  • Output: ml.customerid, ml.customername, ml.ctype, ml.customerlevel, ml.address, ml.customerstatus, ml.plandate, ml.userid, ml.customertype, ml.seq, ml.actualvisittime, ml.visittype, ml.status, ml.isplan, (ml.seq + 0)
4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=265,365.48..265,374.28 rows=880 width=988) (actual rows= loops=)

  • Output: "*SELECT* 1".id, "*SELECT* 1".customername, "*SELECT* 1".store_channeltype, "*SELECT* 1".storelevelname, "*SELECT* 1".address, "*SELECT* 1".status, p.plandate, p.userid, p.customertype, p.seq, a.actualvisittime, a.visittype, ((SubPlan 2)), (1)
  • Group Key: "*SELECT* 1".id, "*SELECT* 1".customername, "*SELECT* 1".store_channeltype, "*SELECT* 1".storelevelname, "*SELECT* 1".address, "*SELECT* 1".status, p.plandate, p.userid, p.customertype, p.seq, a.actualvisittime, a.visittype, ((SubPlan 2)), (1)
5. 0.000 0.000 ↓ 0.0

Append (cost=221.77..265,334.68 rows=880 width=988) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=221.77..138,552.43 rows=872 width=242) (actual rows= loops=)

  • Output: "*SELECT* 1".id, "*SELECT* 1".customername, "*SELECT* 1".store_channeltype, "*SELECT* 1".storelevelname, "*SELECT* 1".address, "*SELECT* 1".status, p.plandate, p.userid, p.customertype, p.seq, a.actualvisittime, a.visittype, (SubPlan 2), 1
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.58..33.34 rows=1 width=46) (actual rows= loops=)

  • Output: p.plandate, p.userid, p.customertype, p.seq, p.customerid, a.actualvisittime, a.visittype
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.29..17.37 rows=1 width=46) (actual rows= loops=)

  • Output: p.plandate, p.userid, p.customertype, p.seq, p.customerid, a.actualvisittime, a.visittype
9. 0.000 0.000 ↓ 0.0

Seq Scan on public.kx_visit_planvisit p (cost=0.00..1.36 rows=1 width=36) (actual rows= loops=)

  • Output: p.platcreatetime, p.platupdatetime, p.platcreateop, p.platupdateop, p.platstatus, p.planid, p.plandate, p.userid, p.account, p.customerid, p.customertype, p.seq, p.status, p.tn_source
  • Filter: ((p.plandate >= '2020-05-19'::date) AND (p.plandate <= '2020-05-19'::date) AND (p.platstatus = 1) AND (p.userid = '1211917550779240448'::bigint))
10. 0.000 0.000 ↓ 0.0

Index Scan using idx_kx_visit_actual_customerid on public.kx_visit_actual a (cost=0.29..16.00 rows=1 width=26) (actual rows= loops=)

  • Output: a.platcreatetime, a.platupdatetime, a.platcreateop, a.platupdateop, a.platstatus, a.actualvisitid, a.actualvisitdate, a.userid, a.customerid, a.visittype, a.actualvisittime, a.customertype
  • Index Cond: (a.customerid = p.customerid)
  • Filter: ((a.actualvisittime >= '2020-05-19 00:00:00'::timestamp without time zone) AND (a.actualvisittime <= '2020-05-19 23:59:59'::timestamp without time zone) AND (a.userid = '1211917550779240448'::bigint) AND (a.platstatus = 1) AND (a.userid = p.userid))
11. 0.000 0.000 ↓ 0.0

Index Scan using idx_kx_visit_customerstatus_customerid on public.kx_visit_customerstatus vc (cost=0.29..15.96 rows=1 width=24) (actual rows= loops=)

  • Output: vc.platcreatetime, vc.platupdatetime, vc.platcreateop, vc.platupdateop, vc.platstatus, vc.id, vc.customerid, vc.customertype, vc.status, vc.userid, vc.visitdate, vc.isplan, vc.workid, vc.createtime, vc.updatetime
  • Index Cond: (vc.customerid = p.customerid)
  • Filter: ((vc.visitdate >= '2020-05-19'::date) AND (vc.visitdate <= '2020-05-19'::date) AND (vc.userid = '1211917550779240448'::bigint) AND (vc.platstatus = 1) AND (vc.userid = p.userid) AND (vc.customertype = p.customertype))
12. 0.000 0.000 ↓ 0.0

Append (cost=221.18..126,637.63 rows=3 width=196) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=221.18..126,115.73 rows=1 width=196) (actual rows= loops=)

  • Output: "*SELECT* 1".id, "*SELECT* 1".customername, "*SELECT* 1".store_channeltype, "*SELECT* 1".storelevelname, "*SELECT* 1".address, "*SELECT* 1".status
  • Filter: (p.customerid = "*SELECT* 1".id)
14. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=221.18..123,944.70 rows=173,682 width=1,672) (actual rows= loops=)

  • Output: ks.id, NULL::character varying(200), ks.storename, NULL::character varying(200), NULL::bigint, NULL::character varying(1000), f_sfa_split_salearea(ps.fullname, 3, 1), NULL::character varying, pd2.dicvalue, pd3.dicvalue, NULL::bigint, ks.status, ks.address, NULL::bigint, NULL::bigint, NULL::timestamp(0) without time zone, NULL::timestamp(0) without time zone, NULL::integer, NULL::bigint
  • Hash Cond: (ks.storelevel = pd3.dickey)
15. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=183.26..79,834.97 rows=173,682 width=256) (actual rows= loops=)

  • Output: ks.id, ks.storename, ks.status, ks.address, ks.storelevel, ps.fullname, pd2.dicvalue
  • Hash Cond: (ks.storetype = pd2.dickey)
16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=145.34..77,408.92 rows=173,682 width=250) (actual rows= loops=)

  • Output: ks.id, ks.storename, ks.status, ks.address, ks.storetype, ks.storelevel, ps.fullname
  • Hash Cond: (ks.channeltype = pd1.dickey)
17. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=107.42..74,982.87 rows=173,682 width=258) (actual rows= loops=)

  • Output: ks.id, ks.storename, ks.status, ks.address, ks.channeltype, ks.storetype, ks.storelevel, ps.fullname
  • Inner Unique: true
  • Hash Cond: (ks.seleareaid = ps.orgstructid)
18. 0.000 0.000 ↓ 0.0

Seq Scan on public.kx_kq_store ks (cost=0.00..74,418.43 rows=173,682 width=200) (actual rows= loops=)

  • Output: ks.platcreatetime, ks.platupdatetime, ks.platcreateop, ks.platupdateop, ks.platstatus, ks.id, ks.storecode, ks.storename, ks.storeshortname, ks.seleareaid, ks.channeltype, ks.storetype, ks.storelevel, ks.contactname, ks.contactphone, ks.contactposition, ks.address, ks.regionid, ks.officephone, ks.iskeystore, ks.remark, ks.status, ks.longitude, ks.latitude, ks.presentative, ks.brand, ks.category, ks.supplier, ks.recentvisittime, ks.supplymode, ks.kaid, ks.customertype, ks.createop, ks.createtime, ks.updatetime, ks.updateop, ks.isvalidaddress, ks.validlocationstatus, ks.kaname, ks.disabletime, ks.approvestatus, ks.auto_tags, ks.manual_tags, ks.distributor, ks.pmmrepresentative, ks.approvetime, ks.kxsaleareaid, ks.isself, ks.tn_iskastore, ks.tn_erp_systemcode, ks.tn_historycode, ks.tn_isdirectsale, ks.tn_recenthelpvisittime, ks.tn_locationtype, ks.tn_storearea, ks.tn_displaypic, ks.tn_gatepic, ks.tn_approval_comments
  • Filter: ((ks.platstatus = 1) AND ((ks.customertype = '905324680615956480'::bigint) OR (ks.customertype = '905324761813487616'::bigint)))
19. 0.000 0.000 ↓ 0.0

Hash (cost=85.52..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps.fullname, ps.orgstructid
20. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_orgstruct ps (cost=0.00..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps.fullname, ps.orgstructid
21. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=8) (actual rows= loops=)

  • Output: pd1.dickey
22. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd1 (cost=0.00..28.52 rows=752 width=8) (actual rows= loops=)

  • Output: pd1.dickey
23. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd2.dicvalue, pd2.dickey
24. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd2 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd2.dicvalue, pd2.dickey
25. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd3.dicvalue, pd3.dickey
26. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd3 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd3.dicvalue, pd3.dickey
27. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_1 (cost=145.34..513.73 rows=1 width=215) (actual rows= loops=)

  • Output: "*SELECT* 2_1".id, "*SELECT* 2_1".customername, "*SELECT* 2_1".store_channeltype, "*SELECT* 2_1".storelevelname, "*SELECT* 2_1".address, "*SELECT* 2_1".status
  • Filter: (p.customerid = "*SELECT* 2_1".id)
28. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=145.34..504.10 rows=770 width=1,691) (actual rows= loops=)

  • Output: kc.id, NULL::character varying(200), kc.channelname, NULL::character varying(200), NULL::bigint, NULL::character varying(1000), f_sfa_split_salearea(ps_1.fullname, 3, 1), NULL::character varying, pd1_1.dicvalue, ''::character varying, NULL::bigint, kc.status, kc.address, NULL::bigint, NULL::bigint, NULL::timestamp(0) without time zone, NULL::timestamp(0) without time zone, NULL::integer, NULL::bigint
  • Hash Cond: (kc.channeltype = pd1_1.dickey)
29. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=107.42..264.92 rows=770 width=243) (actual rows= loops=)

  • Output: kc.id, kc.channelname, kc.status, kc.address, kc.channeltype, ps_1.fullname
  • Inner Unique: true
  • Hash Cond: (kc.saleareaid = ps_1.orgstructid)
30. 0.000 0.000 ↓ 0.0

Seq Scan on public.ka_kq_channelcustomers kc (cost=0.00..155.47 rows=770 width=185) (actual rows= loops=)

  • Output: kc.platcreatetime, kc.platupdatetime, kc.platcreateop, kc.platupdateop, kc.platstatus, kc.channelcode, kc.channelname, kc.saleareaid, kc.contactname, kc.contactphone, kc.contactposition, kc.regionid, kc.address, kc.officephone, kc.fax, kc.email, kc.cooperationtime, kc.remark, kc.status, kc.superiorcustomer, kc.recentvisittime, kc.brand, kc.category, kc.supplier, kc.bizmanager, kc.id, kc.channeltype, kc.customertype, kc.createtime, kc.updatetime, kc.createop, kc.updateop, kc.validlocationstatus, kc.superiorcustomername, kc.supplymode, kc.disabletime, kc.maxaccountnum, kc.cooperativestatus, kc.ishaveadmiaccount, kc.approvestatus, kc.approvetime, kc.kxsaleareaid, kc.channel_archives_id, kc.channel_operatorinfo_id, kc.authorizationinfo_id, kc.channel_addressinfo_id
  • Filter: ((kc.platstatus = 1) AND ((kc.customertype = '905324680615956480'::bigint) OR (kc.customertype = '905324761813487616'::bigint)))
31. 0.000 0.000 ↓ 0.0

Hash (cost=85.52..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_1.fullname, ps_1.orgstructid
32. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_orgstruct ps_1 (cost=0.00..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_1.fullname, ps_1.orgstructid
33. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd1_1.dicvalue, pd1_1.dickey
34. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd1_1 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd1_1.dicvalue, pd1_1.dickey
35. 0.000 0.000 ↓ 0.0

Index Scan using kx_kq_ka_pkey on public.kx_kq_ka ka (cost=0.14..8.17 rows=1 width=91) (actual rows= loops=)

  • Output: ka.id, ka.kasystemname, ''::character varying, ''::character varying, ka.address, ka.status
  • Index Cond: (ka.id = p.customerid)
  • Filter: ((ka.platstatus = 1) AND ((ka.customertype = '905324680615956480'::bigint) OR (ka.customertype = '905324761813487616'::bigint)))
36.          

SubPlan (for Nested Loop)

37. 0.000 0.000 ↓ 0.0

Limit (cost=13.62..13.63 rows=1 width=12) (actual rows= loops=)

  • Output: vc_2.status, vc_2.updatetime
38. 0.000 0.000 ↓ 0.0

Sort (cost=13.62..13.63 rows=1 width=12) (actual rows= loops=)

  • Output: vc_2.status, vc_2.updatetime
  • Sort Key: vc_2.updatetime DESC
39. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on public.kx_visit_customerstatus vc_2 (cost=9.59..13.61 rows=1 width=12) (actual rows= loops=)

  • Output: vc_2.status, vc_2.updatetime
  • Recheck Cond: ((vc_2.customerid = p.customerid) AND (vc_2.userid = p.userid))
  • Filter: ((vc_2.visitdate >= '2020-05-19'::date) AND (vc_2.visitdate <= '2020-05-19'::date) AND (vc_2.customertype = p.customertype) AND (vc_2.platstatus = 1))
40. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=9.59..9.59 rows=1 width=0) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_customerstatus_customerid (cost=0.00..4.32 rows=3 width=0) (actual rows= loops=)

  • Index Cond: (vc_2.customerid = p.customerid)
42. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_customerstatus_userid (cost=0.00..5.02 rows=97 width=0) (actual rows= loops=)

  • Index Cond: (vc_2.userid = p.userid)
43. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=242.56..126,773.53 rows=8 width=242) (actual rows= loops=)

  • Output: "*SELECT* 2".customerid, "*SELECT* 2".customername, "*SELECT* 2".ctype, "*SELECT* 2".customerlevel, "*SELECT* 2".address, "*SELECT* 2".customerstatus, "*SELECT* 2".plandate, "*SELECT* 2".userid, "*SELECT* 2".customertype, 0, "*SELECT* 2".actualvisittime, "*SELECT* 2".visittype, "*SELECT* 2".status, 2
44. 0.000 0.000 ↓ 0.0

Nested Loop (cost=242.56..126,773.43 rows=8 width=238) (actual rows= loops=)

  • Output: "*SELECT* 1_1".id, "*SELECT* 1_1".customername, "*SELECT* 1_1".store_channeltype, "*SELECT* 1_1".storelevelname, "*SELECT* 1_1".address, "*SELECT* 1_1".status, p_1.actualvisitdate, p_1.userid, p_1.customertype, 0, p_1.actualvisittime, p_1.visittype, (SubPlan 1), 2
45. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=21.38..26.77 rows=1 width=38) (actual rows= loops=)

  • Output: p_1.actualvisitdate, p_1.userid, p_1.customertype, p_1.actualvisittime, p_1.visittype, p_1.customerid
  • Join Filter: ((kx_visit_planvisit.userid = p_1.userid) AND (kx_visit_planvisit.customerid = p_1.customerid))
46. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on public.kx_visit_actual p_1 (cost=21.38..25.40 rows=1 width=38) (actual rows= loops=)

  • Output: p_1.platcreatetime, p_1.platupdatetime, p_1.platcreateop, p_1.platupdateop, p_1.platstatus, p_1.actualvisitid, p_1.actualvisitdate, p_1.userid, p_1.customerid, p_1.visittype, p_1.actualvisittime, p_1.customertype
  • Recheck Cond: ((p_1.actualvisitdate >= '2020-05-19'::date) AND (p_1.actualvisitdate <= '2020-05-19'::date) AND (p_1.userid = '1211917550779240448'::bigint))
  • Filter: (p_1.platstatus = 1)
47. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=21.38..21.38 rows=1 width=0) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_actual_actualvisitdate (cost=0.00..10.52 rows=223 width=0) (actual rows= loops=)

  • Index Cond: ((p_1.actualvisitdate >= '2020-05-19'::date) AND (p_1.actualvisitdate <= '2020-05-19'::date))
49. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_actual_userid (cost=0.00..10.60 rows=308 width=0) (actual rows= loops=)

  • Index Cond: (p_1.userid = '1211917550779240448'::bigint)
50. 0.000 0.000 ↓ 0.0

Seq Scan on public.kx_visit_planvisit (cost=0.00..1.36 rows=1 width=16) (actual rows= loops=)

  • Output: kx_visit_planvisit.platcreatetime, kx_visit_planvisit.platupdatetime, kx_visit_planvisit.platcreateop, kx_visit_planvisit.platupdateop, kx_visit_planvisit.platstatus, kx_visit_planvisit.planid, kx_visit_planvisit.plandate, kx_visit_planvisit.userid, kx_visit_planvisit.account, kx_visit_planvisit.customerid, kx_visit_planvisit.customertype, kx_visit_planvisit.seq, kx_visit_planvisit.status, kx_visit_planvisit.tn_source
  • Filter: ((kx_visit_planvisit.plandate >= '2020-05-19'::date) AND (kx_visit_planvisit.plandate <= '2020-05-19'::date) AND (kx_visit_planvisit.userid = '1211917550779240448'::bigint) AND (kx_visit_planvisit.platstatus = 1))
51. 0.000 0.000 ↓ 0.0

Append (cost=221.18..126,637.63 rows=3 width=196) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=221.18..126,115.73 rows=1 width=196) (actual rows= loops=)

  • Output: "*SELECT* 1_1".id, "*SELECT* 1_1".customername, "*SELECT* 1_1".store_channeltype, "*SELECT* 1_1".storelevelname, "*SELECT* 1_1".address, "*SELECT* 1_1".status
  • Filter: (p_1.customerid = "*SELECT* 1_1".id)
53. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=221.18..123,944.70 rows=173,682 width=1,672) (actual rows= loops=)

  • Output: ks_1.id, NULL::character varying(200), ks_1.storename, NULL::character varying(200), NULL::bigint, NULL::character varying(1000), f_sfa_split_salearea(ps_2.fullname, 3, 1), NULL::character varying, pd2_1.dicvalue, pd3_1.dicvalue, NULL::bigint, ks_1.status, ks_1.address, NULL::bigint, NULL::bigint, NULL::timestamp(0) without time zone, NULL::timestamp(0) without time zone, NULL::integer, NULL::bigint
  • Hash Cond: (ks_1.storelevel = pd3_1.dickey)
54. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=183.26..79,834.97 rows=173,682 width=256) (actual rows= loops=)

  • Output: ks_1.id, ks_1.storename, ks_1.status, ks_1.address, ks_1.storelevel, ps_2.fullname, pd2_1.dicvalue
  • Hash Cond: (ks_1.storetype = pd2_1.dickey)
55. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=145.34..77,408.92 rows=173,682 width=250) (actual rows= loops=)

  • Output: ks_1.id, ks_1.storename, ks_1.status, ks_1.address, ks_1.storetype, ks_1.storelevel, ps_2.fullname
  • Hash Cond: (ks_1.channeltype = pd1_2.dickey)
56. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=107.42..74,982.87 rows=173,682 width=258) (actual rows= loops=)

  • Output: ks_1.id, ks_1.storename, ks_1.status, ks_1.address, ks_1.channeltype, ks_1.storetype, ks_1.storelevel, ps_2.fullname
  • Inner Unique: true
  • Hash Cond: (ks_1.seleareaid = ps_2.orgstructid)
57. 0.000 0.000 ↓ 0.0

Seq Scan on public.kx_kq_store ks_1 (cost=0.00..74,418.43 rows=173,682 width=200) (actual rows= loops=)

  • Output: ks_1.platcreatetime, ks_1.platupdatetime, ks_1.platcreateop, ks_1.platupdateop, ks_1.platstatus, ks_1.id, ks_1.storecode, ks_1.storename, ks_1.storeshortname, ks_1.seleareaid, ks_1.channeltype, ks_1.storetype, ks_1.storelevel, ks_1.contactname, ks_1.contactphone, ks_1.contactposition, ks_1.address, ks_1.regionid, ks_1.officephone, ks_1.iskeystore, ks_1.remark, ks_1.status, ks_1.longitude, ks_1.latitude, ks_1.presentative, ks_1.brand, ks_1.category, ks_1.supplier, ks_1.recentvisittime, ks_1.supplymode, ks_1.kaid, ks_1.customertype, ks_1.createop, ks_1.createtime, ks_1.updatetime, ks_1.updateop, ks_1.isvalidaddress, ks_1.validlocationstatus, ks_1.kaname, ks_1.disabletime, ks_1.approvestatus, ks_1.auto_tags, ks_1.manual_tags, ks_1.distributor, ks_1.pmmrepresentative, ks_1.approvetime, ks_1.kxsaleareaid, ks_1.isself, ks_1.tn_iskastore, ks_1.tn_erp_systemcode, ks_1.tn_historycode, ks_1.tn_isdirectsale, ks_1.tn_recenthelpvisittime, ks_1.tn_locationtype, ks_1.tn_storearea, ks_1.tn_displaypic, ks_1.tn_gatepic, ks_1.tn_approval_comments
  • Filter: ((ks_1.platstatus = 1) AND ((ks_1.customertype = '905324680615956480'::bigint) OR (ks_1.customertype = '905324761813487616'::bigint)))
58. 0.000 0.000 ↓ 0.0

Hash (cost=85.52..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_2.fullname, ps_2.orgstructid
  • Buckets: 2048 Batches: 1 Memory Usage: 87kB
59. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_orgstruct ps_2 (cost=0.00..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_2.fullname, ps_2.orgstructid
60. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=8) (actual rows= loops=)

  • Output: pd1_2.dickey
  • Buckets: 1024 Batches: 1 Memory Usage: 37kB
61. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd1_2 (cost=0.00..28.52 rows=752 width=8) (actual rows= loops=)

  • Output: pd1_2.dickey
62. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd2_1.dicvalue, pd2_1.dickey
  • Buckets: 1024 Batches: 1 Memory Usage: 50kB
63. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd2_1 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd2_1.dicvalue, pd2_1.dickey
64. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd3_1.dicvalue, pd3_1.dickey
  • Buckets: 1024 Batches: 1 Memory Usage: 50kB
65. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd3_1 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd3_1.dicvalue, pd3_1.dickey
66. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_2 (cost=145.34..513.73 rows=1 width=215) (actual rows= loops=)

  • Output: "*SELECT* 2_2".id, "*SELECT* 2_2".customername, "*SELECT* 2_2".store_channeltype, "*SELECT* 2_2".storelevelname, "*SELECT* 2_2".address, "*SELECT* 2_2".status
  • Filter: (p_1.customerid = "*SELECT* 2_2".id)
67. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=145.34..504.10 rows=770 width=1,691) (actual rows= loops=)

  • Output: kc_1.id, NULL::character varying(200), kc_1.channelname, NULL::character varying(200), NULL::bigint, NULL::character varying(1000), f_sfa_split_salearea(ps_3.fullname, 3, 1), NULL::character varying, pd1_3.dicvalue, ''::character varying, NULL::bigint, kc_1.status, kc_1.address, NULL::bigint, NULL::bigint, NULL::timestamp(0) without time zone, NULL::timestamp(0) without time zone, NULL::integer, NULL::bigint
  • Hash Cond: (kc_1.channeltype = pd1_3.dickey)
68. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=107.42..264.92 rows=770 width=243) (actual rows= loops=)

  • Output: kc_1.id, kc_1.channelname, kc_1.status, kc_1.address, kc_1.channeltype, ps_3.fullname
  • Inner Unique: true
  • Hash Cond: (kc_1.saleareaid = ps_3.orgstructid)
69. 0.000 0.000 ↓ 0.0

Seq Scan on public.ka_kq_channelcustomers kc_1 (cost=0.00..155.47 rows=770 width=185) (actual rows= loops=)

  • Output: kc_1.platcreatetime, kc_1.platupdatetime, kc_1.platcreateop, kc_1.platupdateop, kc_1.platstatus, kc_1.channelcode, kc_1.channelname, kc_1.saleareaid, kc_1.contactname, kc_1.contactphone, kc_1.contactposition, kc_1.regionid, kc_1.address, kc_1.officephone, kc_1.fax, kc_1.email, kc_1.cooperationtime, kc_1.remark, kc_1.status, kc_1.superiorcustomer, kc_1.recentvisittime, kc_1.brand, kc_1.category, kc_1.supplier, kc_1.bizmanager, kc_1.id, kc_1.channeltype, kc_1.customertype, kc_1.createtime, kc_1.updatetime, kc_1.createop, kc_1.updateop, kc_1.validlocationstatus, kc_1.superiorcustomername, kc_1.supplymode, kc_1.disabletime, kc_1.maxaccountnum, kc_1.cooperativestatus, kc_1.ishaveadmiaccount, kc_1.approvestatus, kc_1.approvetime, kc_1.kxsaleareaid, kc_1.channel_archives_id, kc_1.channel_operatorinfo_id, kc_1.authorizationinfo_id, kc_1.channel_addressinfo_id
  • Filter: ((kc_1.platstatus = 1) AND ((kc_1.customertype = '905324680615956480'::bigint) OR (kc_1.customertype = '905324761813487616'::bigint)))
70. 0.000 0.000 ↓ 0.0

Hash (cost=85.52..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_3.fullname, ps_3.orgstructid
  • Buckets: 2048 Batches: 1 Memory Usage: 87kB
71. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_orgstruct ps_3 (cost=0.00..85.52 rows=1,752 width=74) (actual rows= loops=)

  • Output: ps_3.fullname, ps_3.orgstructid
72. 0.000 0.000 ↓ 0.0

Hash (cost=28.52..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd1_3.dicvalue, pd1_3.dickey
  • Buckets: 1024 Batches: 1 Memory Usage: 50kB
73. 0.000 0.000 ↓ 0.0

Seq Scan on public.pl_dictionary pd1_3 (cost=0.00..28.52 rows=752 width=22) (actual rows= loops=)

  • Output: pd1_3.dicvalue, pd1_3.dickey
74. 0.000 0.000 ↓ 0.0

Index Scan using kx_kq_ka_pkey on public.kx_kq_ka ka_1 (cost=0.14..8.17 rows=1 width=91) (actual rows= loops=)

  • Output: ka_1.id, ka_1.kasystemname, ''::character varying, ''::character varying, ka_1.address, ka_1.status
  • Index Cond: (ka_1.id = p_1.customerid)
  • Filter: ((ka_1.platstatus = 1) AND ((ka_1.customertype = '905324680615956480'::bigint) OR (ka_1.customertype = '905324761813487616'::bigint)))
75.          

SubPlan (for Nested Loop)

76. 0.000 0.000 ↓ 0.0

Limit (cost=13.62..13.63 rows=1 width=12) (actual rows= loops=)

  • Output: vc_1.status, vc_1.updatetime
77. 0.000 0.000 ↓ 0.0

Sort (cost=13.62..13.63 rows=1 width=12) (actual rows= loops=)

  • Output: vc_1.status, vc_1.updatetime
  • Sort Key: vc_1.updatetime DESC
78. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on public.kx_visit_customerstatus vc_1 (cost=9.59..13.61 rows=1 width=12) (actual rows= loops=)

  • Output: vc_1.status, vc_1.updatetime
  • Recheck Cond: ((vc_1.customerid = p_1.customerid) AND (vc_1.userid = p_1.userid))
  • Filter: ((vc_1.visitdate >= '2020-05-19'::date) AND (vc_1.visitdate <= '2020-05-19'::date) AND (vc_1.customertype = p_1.customertype) AND (vc_1.platstatus = 1))
79. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=9.59..9.59 rows=1 width=0) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_customerstatus_customerid (cost=0.00..4.32 rows=3 width=0) (actual rows= loops=)

  • Index Cond: (vc_1.customerid = p_1.customerid)
81. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_kx_visit_customerstatus_userid (cost=0.00..5.02 rows=97 width=0) (actual rows= loops=)

  • Index Cond: (vc_1.userid = p_1.userid)