explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4ako

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 28,908.022 ↑ 1.0 20 1

Limit (cost=514,589.12..514,589.17 rows=20 width=948) (actual time=28,908.019..28,908.022 rows=20 loops=1)

  • Output: e.id, s.storename, p.costname, p.begindate, p.enddate, e.exectime, (NULL::timestamp without time zone), e.exectime, ('已执行'::text), (''::text), w.recordid
2. 0.138 28,908.019 ↑ 20.1 20 1

Sort (cost=514,589.12..514,590.12 rows=403 width=948) (actual time=28,908.018..28,908.019 rows=20 loops=1)

  • Output: e.id, s.storename, p.costname, p.begindate, p.enddate, e.exectime, (NULL::timestamp without time zone), e.exectime, ('已执行'::text), (''::text), w.recordid
  • Sort Key: e.exectime DESC
  • Sort Method: top-N heapsort Memory: 34kB
3. 1.555 28,907.881 ↑ 1.3 311 1

HashAggregate (cost=514,570.33..514,574.36 rows=403 width=948) (actual time=28,907.717..28,907.881 rows=311 loops=1)

  • Output: e.id, s.storename, p.costname, p.begindate, p.enddate, e.exectime, (NULL::timestamp without time zone), e.exectime, ('已执行'::text), (''::text), w.recordid
  • Group Key: e.id, s.storename, p.costname, p.begindate, p.enddate, e.exectime, (NULL::timestamp without time zone), e.exectime, ('已执行'::text), (''::text), w.recordid
4. 0.171 28,906.326 ↑ 1.3 311 1

Append (cost=856.84..514,559.25 rows=403 width=948) (actual time=55.181..28,906.326 rows=311 loops=1)

5. 1.024 28,906.154 ↑ 1.3 311 1

Nested Loop Left Join (cost=856.84..514,555.23 rows=402 width=165) (actual time=55.180..28,906.154 rows=311 loops=1)

  • Output: e.id, s.storename, p.costname, p.begindate, p.enddate, e.exectime, NULL::timestamp without time zone, e.exectime, '已执行'::text, ''::text, w.recordid
  • Inner Unique: true
6. 1.560 28,864.389 ↑ 1.3 311 1

Nested Loop Left Join (cost=856.42..511,230.56 rows=402 width=75) (actual time=55.160..28,864.389 rows=311 loops=1)

  • Output: e.id, e.exectime, e.customerid, p.costname, p.begindate, p.enddate, w.recordid
  • Inner Unique: true
7. 2,646.163 28,856.609 ↑ 1.3 311 1

Hash Right Join (cost=856.14..510,536.17 rows=402 width=40) (actual time=55.143..28,856.609 rows=311 loops=1)

  • Output: e.id, e.exectime, e.costid, e.customerid, w.recordid
  • Inner Unique: true
  • Hash Cond: (w.visitcontentid = e.id)
8. 26,209.273 26,209.273 ↑ 1.0 13,582,114 1

Seq Scan on public.kx_visit_workrecord w (cost=0.00..474,021.49 rows=13,584,199 width=16) (actual time=0.011..26,209.273 rows=13,582,114 loops=1)

  • Output: w.platcreatetime, w.platupdatetime, w.platcreateop, w.platupdateop, w.platstatus, w.recordid, w.recorddate, w.userid, w.customerid, w.visittime, w.visitcontent, w.remark, w.customertype, w.visitcontentid, w.workid, w.stepid, w.casecode, w.visitstatus, w.skipreason
  • Filter: (w.platstatus = 1)
9. 0.068 1.173 ↓ 1.4 311 1

Hash (cost=853.28..853.28 rows=229 width=32) (actual time=1.172..1.173 rows=311 loops=1)

  • Output: e.id, e.exectime, e.costid, e.customerid
  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
10. 1.105 1.105 ↓ 1.4 311 1

Index Scan using kx_cost_display_exec_execop_idx on public.kx_cost_display_exec e (cost=0.43..853.28 rows=229 width=32) (actual time=0.045..1.105 rows=311 loops=1)

  • Output: e.id, e.exectime, e.costid, e.customerid
  • Index Cond: (e.execop = '1298255436377624576'::bigint)
  • Filter: (e.platstatus = 1)
11. 6.220 6.220 ↑ 1.0 1 311

Index Scan using kx_cost_plan_pkey on public.kx_cost_plan p (cost=0.28..1.73 rows=1 width=51) (actual time=0.020..0.020 rows=1 loops=311)

  • Output: p.platcreatetime, p.platupdatetime, p.platcreateop, p.platupdateop, p.platstatus, p.id, p.costcode, p.costname, p.putinmonth, p.begindate, p.enddate, p.checkflag, p.costamount, p.singlelimit, p.targetsaleamount, p.targetsales, p.costmodel, p.costform, p.putincustomertype, p.costtype, p.applyop, p.content, p.status, p.remark, p.attachaddr, p.auditop, p.areaneedapply, p.putscopearea, p.putscopeka, p.putscopechanneltype, p.specifycustomer, p.allocationtype, p.putchannelcustomertype, p.createop, p.updateop, p.createtime, p.updatetime, p.applyopareaid, p.putinfostatus, p.deadline, p.cerate, p.costrate, p.verficationamount, p.ishistory, p.parentid, p.activitymode, p.freezeamount, p.useamount, p.vstatus, p.activearea, p.vmodel, p.immediately, p.hxcode, p.tn_putchannel, p.tn_paytype, p.tn_haschild, p.tn_createdate, p.ispay, p.astatus, p.tn_plan_take, p.tn_plan_sale, p.tn_plan_cost, p.tn_single_cost, p.tn_delivery_store_number, p.tn_factory_summary_mark, p.tn_auditopinion, p.tn_richid, p.verificationcode, p.closetime
  • Index Cond: (e.costid = p.id)
  • Filter: (p.platstatus = 1)
12. 40.741 40.741 ↑ 1.0 1 311

Index Scan using kx_kq_store_pkey on public.kx_kq_store s (cost=0.42..8.27 rows=1 width=26) (actual time=0.131..0.131 rows=1 loops=311)

  • Output: s.storename, s.id
  • Index Cond: (s.id = e.customerid)
  • Filter: (s.platstatus = 1)
13. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=165) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: id, storename, costname, begindate, enddate, NULL::timestamp without time zone, cashtime, cashtime, '已兑付'::text, CASE WHEN (paymethod = 1) THEN '现金'::text WHEN (paymethod = 2) THEN '货补'::text ELSE ''::text END, NULL::bigint
  • One-Time Filter: false