explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y4c5

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 31.081 ↓ 2.0 2 1

Limit (cost=3,190.90..3,190.93 rows=1 width=122) (actual time=31.075..31.081 rows=2 loops=1)

2. 0.005 31.079 ↓ 2.0 2 1

Unique (cost=3,190.90..3,190.93 rows=1 width=122) (actual time=31.074..31.079 rows=2 loops=1)

3. 0.056 31.074 ↓ 4.0 4 1

Sort (cost=3,190.90..3,190.91 rows=1 width=122) (actual time=31.073..31.074 rows=4 loops=1)

  • Sort Key: kcp.id, kcp.costname, kcp.activitymode, pld.dicvalue, ((((kcp.begindate)::text || '至'::text) || (kcp.enddate)::text)), (CASE WHEN ((count(ap.id)) IS NULL) THEN '待上报'::text ELSE '已上报'::text END), ((SubPlan 1))
  • Sort Method: quicksort Memory: 25kB
4. 0.067 31.018 ↓ 4.0 4 1

Nested Loop (cost=2,795.07..3,190.89 rows=1 width=122) (actual time=23.305..31.018 rows=4 loops=1)

  • Join Filter: (kcp.id = kx_cost_customer.costid)
  • Rows Removed by Join Filter: 246
5. 0.069 6.595 ↓ 4.0 4 1

Nested Loop (cost=195.34..353.74 rows=1 width=74) (actual time=5.955..6.595 rows=4 loops=1)

  • Join Filter: (kcp.id = km.costid)
  • Rows Removed by Join Filter: 366
6. 0.022 4.556 ↓ 5.0 5 1

Nested Loop Left Join (cost=195.34..290.91 rows=1 width=66) (actual time=3.707..4.556 rows=5 loops=1)

  • Join Filter: (ap.costid = kcp.id)
  • Rows Removed by Join Filter: 72
7. 0.007 0.979 ↓ 5.0 5 1

Nested Loop Left Join (cost=0.28..95.59 rows=1 width=58) (actual time=0.251..0.979 rows=5 loops=1)

8. 0.887 0.887 ↓ 5.0 5 1

Seq Scan on kx_cost_plan kcp (cost=0.00..87.28 rows=1 width=46) (actual time=0.207..0.887 rows=5 loops=1)

  • Filter: ((activitymode <> '1062165749977714688'::bigint) AND ((vstatus <> 3) OR (vstatus IS NULL)) AND (status = 1) AND (platstatus = 1) AND (costmodel = '1060075344423424000'::bigint) AND (enddate >= CURRENT_DATE) AND ((begindate - '7 days'::interval) <= CURRENT_DATE))
  • Rows Removed by Filter: 407
9. 0.085 0.085 ↑ 1.0 1 5

Index Scan using idx_pl_dictionary_dickey on pl_dictionary pld (cost=0.28..8.29 rows=1 width=20) (actual time=0.016..0.017 rows=1 loops=5)

  • Index Cond: (kcp.activitymode = dickey)
  • Filter: (platstatus = 1)
10. 0.085 3.555 ↓ 2.5 15 5

GroupAggregate (cost=195.07..195.19 rows=6 width=24) (actual time=0.692..0.711 rows=15 loops=5)

  • Group Key: ap.costid, ap.userid
11. 0.056 3.470 ↓ 5.8 35 5

Sort (cost=195.07..195.08 rows=6 width=24) (actual time=0.689..0.694 rows=35 loops=5)

  • Sort Key: ap.costid
  • Sort Method: quicksort Memory: 27kB
12. 0.045 3.414 ↓ 5.8 35 1

Nested Loop (cost=18.78..194.99 rows=6 width=24) (actual time=2.013..3.414 rows=35 loops=1)

13. 0.959 3.169 ↓ 1.1 50 1

Hash Join (cost=18.50..179.49 rows=46 width=32) (actual time=1.984..3.169 rows=50 loops=1)

  • Hash Cond: (se.id = ap.seid)
14. 1.992 1.992 ↓ 1.0 4,243 1

Seq Scan on kx_cost_active_step_exec se (cost=0.00..144.71 rows=4,217 width=16) (actual time=0.004..1.992 rows=4,243 loops=1)

  • Filter: (platstatus = 1)
15. 0.021 0.218 ↓ 1.1 50 1

Hash (cost=17.93..17.93 rows=46 width=32) (actual time=0.218..0.218 rows=50 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
16. 0.197 0.197 ↓ 1.1 50 1

Seq Scan on kx_cost_activie_photo ap (cost=0.00..17.93 rows=46 width=32) (actual time=0.015..0.197 rows=50 loops=1)

  • Filter: ((platstatus = 1) AND (userid = '1150584962391609344'::bigint))
  • Rows Removed by Filter: 138
17. 0.200 0.200 ↑ 1.0 1 50

Index Scan using pk_kx_cost_active_exec_1 on kx_cost_active_exec ae (cost=0.28..0.34 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=50)

  • Index Cond: (id = se.eid)
  • Filter: ((tn_auditstatus <> 3) AND (platstatus = 1))
  • Rows Removed by Filter: 0
18. 1.970 1.970 ↓ 1.2 74 5

Seq Scan on kx_cost_budget_share_detail km (cost=0.00..62.09 rows=60 width=8) (actual time=0.193..0.394 rows=74 loops=5)

  • Filter: ((platstatus = 1) AND (personid = '1150584962391609344'::bigint))
  • Rows Removed by Filter: 1,289
19. 0.116 10.652 ↑ 4.7 62 4

HashAggregate (cost=2,599.73..2,602.65 rows=292 width=8) (actual time=2.647..2.663 rows=62 loops=4)

  • Group Key: kx_cost_customer.costid
20. 0.019 10.536 ↑ 3.4 87 1

Append (cost=572.14..2,599.00 rows=292 width=8) (actual time=4.306..10.536 rows=87 loops=1)

21. 0.018 4.327 ↑ 2.2 18 1

Group (cost=572.14..572.34 rows=40 width=8) (actual time=4.306..4.327 rows=18 loops=1)

  • Group Key: kx_cost_customer.costid
22. 0.043 4.309 ↓ 1.4 55 1

Sort (cost=572.14..572.24 rows=40 width=8) (actual time=4.301..4.309 rows=55 loops=1)

  • Sort Key: kx_cost_customer.costid
  • Sort Method: quicksort Memory: 27kB
23. 0.246 4.266 ↓ 1.4 55 1

Hash Semi Join (cost=525.02..571.08 rows=40 width=8) (actual time=3.858..4.266 rows=55 loops=1)

  • Hash Cond: (kx_cost_customer.customerid = kx_kq_store.id)
24. 0.530 0.530 ↓ 1.0 957 1

Seq Scan on kx_cost_customer (cost=0.00..43.11 rows=954 width=16) (actual time=0.014..0.530 rows=957 loops=1)

  • Filter: (platstatus = 1)
  • Rows Removed by Filter: 15
25. 0.029 3.490 ↓ 3.8 73 1

Hash (cost=524.78..524.78 rows=19 width=8) (actual time=3.490..3.490 rows=73 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
26. 0.016 3.461 ↓ 3.8 73 1

Append (cost=25.27..524.78 rows=19 width=8) (actual time=0.085..3.461 rows=73 loops=1)

27. 1.857 1.914 ↓ 29.0 29 1

Bitmap Heap Scan on kx_kq_store (cost=25.27..454.69 rows=1 width=8) (actual time=0.084..1.914 rows=29 loops=1)

  • Recheck Cond: (seleareaid = '1140792287312351232'::bigint)
  • Filter: (((presentative)::text ~~ '%1150584962391609344%'::text) AND (platstatus = 1))
  • Rows Removed by Filter: 103
  • Heap Blocks: exact=100
28. 0.057 0.057 ↓ 1.1 140 1

Bitmap Index Scan on idx_kx_kq_store_seleareaid (cost=0.00..25.27 rows=132 width=0) (actual time=0.057..0.057 rows=140 loops=1)

  • Index Cond: (seleareaid = '1140792287312351232'::bigint)
29. 1.531 1.531 ↓ 2.4 44 1

Seq Scan on ka_kq_channelcustomers (cost=0.00..69.90 rows=18 width=8) (actual time=0.017..1.531 rows=44 loops=1)

  • Filter: (((bizmanager)::text ~~ '%1150584962391609344%'::text) AND (saleareaid = '1140792287312351232'::bigint) AND (platstatus = 1))
  • Rows Removed by Filter: 179
30. 0.234 6.190 ↑ 3.7 69 1

Group (cost=2,021.61..2,023.73 rows=252 width=8) (actual time=5.782..6.190 rows=69 loops=1)

  • Group Key: kx_cost_put_customer.costid
31. 0.641 5.956 ↓ 3.4 1,461 1

Sort (cost=2,021.61..2,022.67 rows=425 width=8) (actual time=5.781..5.956 rows=1,461 loops=1)

  • Sort Key: kx_cost_put_customer.costid
  • Sort Method: quicksort Memory: 117kB
32. 0.398 5.315 ↓ 3.4 1,461 1

Nested Loop (cost=529.42..2,003.05 rows=425 width=8) (actual time=1.896..5.315 rows=1,461 loops=1)

33. 0.068 1.851 ↓ 3.8 73 1

HashAggregate (cost=524.83..525.02 rows=19 width=8) (actual time=1.828..1.851 rows=73 loops=1)

  • Group Key: kx_kq_store_1.id
34. 0.017 1.783 ↓ 3.8 73 1

Append (cost=25.27..524.78 rows=19 width=8) (actual time=0.041..1.783 rows=73 loops=1)

35. 0.717 0.742 ↓ 29.0 29 1

Bitmap Heap Scan on kx_kq_store kx_kq_store_1 (cost=25.27..454.69 rows=1 width=8) (actual time=0.041..0.742 rows=29 loops=1)

  • Recheck Cond: (seleareaid = '1140792287312351232'::bigint)
  • Filter: (((presentative)::text ~~ '%1150584962391609344%'::text) AND (platstatus = 1))
  • Rows Removed by Filter: 103
  • Heap Blocks: exact=100
36. 0.025 0.025 ↓ 1.1 140 1

Bitmap Index Scan on idx_kx_kq_store_seleareaid (cost=0.00..25.27 rows=132 width=0) (actual time=0.025..0.025 rows=140 loops=1)

  • Index Cond: (seleareaid = '1140792287312351232'::bigint)
37. 1.024 1.024 ↓ 2.4 44 1

Seq Scan on ka_kq_channelcustomers ka_kq_channelcustomers_1 (cost=0.00..69.90 rows=18 width=8) (actual time=0.008..1.024 rows=44 loops=1)

  • Filter: (((bizmanager)::text ~~ '%1150584962391609344%'::text) AND (saleareaid = '1140792287312351232'::bigint) AND (platstatus = 1))
  • Rows Removed by Filter: 179
38. 2.555 3.066 ↑ 1.1 20 73

Bitmap Heap Scan on kx_cost_put_customer (cost=4.59..77.57 rows=22 width=16) (actual time=0.010..0.042 rows=20 loops=73)

  • Recheck Cond: (customerid = kx_kq_store_1.id)
  • Filter: (platstatus = 1)
  • Heap Blocks: exact=1,243
39. 0.511 0.511 ↓ 1.1 25 73

Bitmap Index Scan on idx_kx_cost_put_customer_customerid (cost=0.00..4.58 rows=22 width=0) (actual time=0.007..0.007 rows=25 loops=73)

  • Index Cond: (customerid = kx_kq_store_1.id)
40.          

SubPlan (for Nested Loop)

41. 0.016 13.704 ↑ 1.0 1 4

Aggregate (cost=227.91..227.92 rows=1 width=8) (actual time=3.425..3.426 rows=1 loops=4)

42. 0.192 13.688 ↓ 4.0 4 4

Nested Loop Semi Join (cost=0.00..227.91 rows=1 width=0) (actual time=0.687..3.422 rows=4 loops=4)

  • Join Filter: (kcae.id = kx_cost_active_step_exec.eid)
  • Rows Removed by Join Filter: 230
43. 1.456 1.456 ↓ 4.0 4 4

Seq Scan on kx_cost_active_exec kcae (cost=0.00..61.14 rows=1 width=8) (actual time=0.297..0.364 rows=4 loops=4)

  • Filter: ((tn_auditstatus IS NOT NULL) AND (costid = kcp.id) AND (userid = '1150584962391609344'::bigint) AND (platstatus = 1))
  • Rows Removed by Filter: 1,626
44. 12.040 12.040 ↑ 1.2 67 14

Seq Scan on kx_cost_active_step_exec (cost=0.00..165.80 rows=78 width=8) (actual time=0.033..0.860 rows=67 loops=14)

  • Filter: ((status = 1) AND (platstatus = 1) AND (stepid = '1062181344873943040'::bigint))
  • Rows Removed by Filter: 3,977
Planning time : 10.251 ms
Execution time : 31.621 ms