Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
hi guys, i'm running a busy server with a very big query blocking many others queries. the point is...
there's a query with update or delete?
could we add a column about query type? examples:
SET query (set variable= xxx)
SELECT query (select * from table...)
UPDATE query
REPLACE query
DELETE query
etc etc...
and a column (when possible) about what tables will be used? this help with waiting table lock...
this help a lot seeing what could be blocked (or not)
today to do this i should parse the query, since queries have a big comment to get information about user, ip, session, pid and file being used, a new column could be easier to see that
here a output of my today processlist when some queries was being blocked
ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | TIME_MS | STAGE | MAX_STAGE | PROGRESS | MEMORY_USED | EXAMINED_ROWS |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53224 | rspadim | 187.65.224.39:32957 | information_schema | Query | 0 | executing | SELECT `ID`, `USER`, `HOST`, `DB`, `COMMAND`, `TIME`, `STATE`, `INFO`, `TIME_MS`, `STAGE`, `MAX_STAGE`, `PROGRESS`, `MEMORY_USED`, `EXAMINED_ROWS` FROM `information_schema`.`PROCESSLIST` LIMIT 1000 | 0.402 | 0 | 0 | 0.000 | 75640 | 0 |
35707 | rspadim | 187.65.224.39:33181 | 19_org | Query | 225 | Waiting for table level lock | explain /* pid:18029 spd_user: adm.jn SELF='/rdm-business/app/industria.pcp.spadim' ms=7 ip=10.10.0.26 session=mojydk.kz8frkrnm8ki220duxhk4kkwcwk8gw4osg */SELECT a.unidade_id,a.lote_spa,a.lote_tipo,a.vendedor_tipo,a.vendedor_id,a.cliente_tipo,a.cliente_id,a.sit_producao,SUM(b.cur_op_quant) AS cur_op_quant,SUM(b.cur_op_quant*b.vliq) AS cur_op_volume_liq,SUM(b.cur_op_quant*b.pliq) AS cur_op_peso_liquido,b.cur_op,b.cur_op_seq,a.sit_pcp,b.item_id,b.item_id_red,b.cur_oe FROM spamov_itens AS b, spamov AS a WHERE b.unidade_id=a.unidade_id AND b.lote_tipo=a.lote_tipo AND b.lote_spa=a.lote_spa AND a.unidade_id IN ("1001") AND a.abate='N' AND a.lote_tipo IN ('v') AND b.cur_op_quant>0 AND a.producao="Y" AND sit_pcp="mov" AND a.lote_spa>=0 AND a.lote_spa<=99999999999 AND a.cur_oe>=0 AND a.cur_oe<=99999999999 AND b.cur_op=0 AND a.data_digitacao>='2000-01-01 02:00:00' AND a.data_digitacao<='2013-06-18 02:59:59' GROUP BY b.unidade_id,b.item_id,b.item_id_red ORDER BY b.item_id ASC,b.item_id_red ASC | 225428.005 | 0 | 0 | 0.000 | 69744 | 0 |
22406 | rdm | localhost | 19_org | Query | 372 | Waiting for table level lock | /* pid:24552 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 372612.190 | 0 | 0 | 0.000 | 45264 | 0 |
136 | rdm | localhost | 19_org | Query | 527 | Waiting for table level lock | /* pid:25004 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 527491.402 | 0 | 0 | 0.000 | 45264 | 0 |
135 | rdm | localhost | 19_org | Query | 528 | Waiting for table level lock | /* pid:17299 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 528461.488 | 0 | 0 | 0.000 | 45264 | 0 |
134 | rdm | localhost | 19_org | Query | 528 | Waiting for table level lock | /* pid:6361 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 528646.023 | 0 | 0 | 0.000 | 45264 | 0 |
133 | rdm | localhost | 19_org | Query | 529 | Waiting for table level lock | /* pid:18255 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 529645.124 | 0 | 0 | 0.000 | 45264 | 0 |
132 | rdm | localhost | 19_org | Query | 530 | Waiting for table level lock | /* pid:6833 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 530265.900 | 0 | 0 | 0.000 | 45264 | 0 |
131 | rdm | localhost | 19_org | Query | 531 | Waiting for table level lock | /* pid:7104 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 531630.494 | 0 | 0 | 0.000 | 45264 | 0 |
130 | rdm | localhost | 19_org | Query | 532 | Waiting for table level lock | /* pid:26371 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 532872.096 | 0 | 0 | 0.000 | 45264 | 0 |
129 | rdm | localhost | 19_org | Query | 525 | Waiting for table level lock | /* pid:6360 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 525492.411 | 0 | 0 | 0.000 | 45264 | 0 |
128 | rdm | localhost | 19_org | Query | 512 | Waiting for table level lock | /* pid:7089 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 512173.875 | 0 | 0 | 0.000 | 45264 | 0 |
127 | rdm | localhost | 19_org | Query | 541 | Waiting for table level lock | /* pid:26360 spd_user: v.90067 SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.38 session=mojyd7.ufyxq3c3n6ny4b9487e04o0skg4kw4gg4o */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:36:06" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 541262.453 | 0 | 0 | 0.000 | 45264 | 0 |
126 | rdm | localhost | 19_org | Query | 541 | Waiting for table level lock | /* pid:6307 spd_user: couto_it_48 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=187.67.55.11 session=mojyf0.7pi5nb51dedoe4hc1v5csw0g4k44os4cos */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:36:05" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 541629.216 | 0 | 0 | 0.000 | 45264 | 0 |
125 | rdm | localhost | 19_org | Query | 538 | Waiting for table level lock | /* pid:26370 spd_user: ricardo.sup SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.63 session=mojyc0.m3bw9kyvw9lb94juwjhoo0o0k00sscwoc0 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:36:09" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 538323.969 | 0 | 0 | 0.000 | 45264 | 0 |
124 | rdm | localhost | 19_org | Query | 538 | Waiting for table level lock | /* pid:7106 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 538341.577 | 0 | 0 | 0.000 | 45264 | 0 |
123 | rdm | localhost | 19_org | Query | 554 | Waiting for table level lock | /* pid:25003 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 554607.729 | 0 | 0 | 0.000 | 45264 | 0 |
122 | rdm | localhost | 19_org | Query | 554 | Waiting for table level lock | /* pid:26359 spd_user: ger.lima SELF='/rdm-business/app/spa.gerente.spadim' ms=6 ip=10.10.0.8 session=mojyf7.tus5fs5umakn8p0l1n34g84owo0k08k8ck */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:52" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 554962.994 | 0 | 0 | 0.000 | 45264 | 0 |
121 | rdm | localhost | 19_org | Query | 525 | Waiting for table level lock | /* pid:11406 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 525434.632 | 0 | 0 | 0.000 | 45264 | 0 |
120 | rdm | localhost | 19_org | Query | 558 | Waiting for table level lock | /* pid:26132 spd_user: sumye_150 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=4 ip=189.106.12.14 session=mojyc6.9b1fgryx84hw85v4to3y8g0cwwcckkkwgc */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=855174 | 558068.497 | 0 | 0 | 0.000 | 45264 | 0 |
119 | rdm | localhost | 19_org | Query | 561 | Waiting for table level lock | /* pid:7080 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:46" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 561163.967 | 0 | 0 | 0.000 | 45264 | 0 |
117 | rdm | localhost | 19_org | Query | 563 | Waiting for table level lock | /* pid:6595 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 563199.658 | 0 | 0 | 0.000 | 45264 | 0 |
116 | rdm | localhost | 19_org | Query | 563 | Waiting for table level lock | /* pid:10505 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 563204.831 | 0 | 0 | 0.000 | 45264 | 0 |
115 | rdm | localhost | 19_org | Query | 563 | Waiting for table level lock | /* pid:16444 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 563647.830 | 0 | 0 | 0.000 | 45264 | 0 |
114 | rdm | localhost | 19_org | Query | 564 | Waiting for table level lock | /* pid:17322 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 564217.635 | 0 | 0 | 0.000 | 45264 | 0 |
113 | rdm | localhost | 19_org | Query | 564 | Waiting for table level lock | /* pid:6589 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 564362.801 | 0 | 0 | 0.000 | 45264 | 0 |
112 | rdm | localhost | 19_org | Query | 564 | Waiting for table level lock | /* pid:26131 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 564683.159 | 0 | 0 | 0.000 | 45264 | 0 |
111 | rdm | localhost | 19_org | Query | 564 | Waiting for table level lock | /* pid:17577 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 564859.322 | 0 | 0 | 0.000 | 45264 | 0 |
110 | rdm | localhost | 19_org | Query | 565 | Waiting for table level lock | /* pid:17578 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 565052.110 | 0 | 0 | 0.000 | 45264 | 0 |
109 | rdm | localhost | 19_org | Query | 549 | Waiting for table level lock | /* pid:17285 spd_user: v.90102 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-1 ip=200.97.118.126 session=mojyci.emyc19ldicepl5f7fdkgs8w0wcgwkskccc */SELECT distribuidor_tipo,distribuidor_id,vendedor_tipo,vendedor_id,cliente_tipo,cliente_id,d_pag FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456196 | 549257.803 | 0 | 0 | 0.000 | 45264 | 0 |
108 | rdm | localhost | 19_org | Query | 565 | Waiting for table level lock | /* pid:17576 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 565745.667 | 0 | 0 | 0.000 | 45264 | 0 |
107 | rdm | localhost | 19_org | Query | 565 | Waiting for table level lock | /* pid:7098 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 565915.260 | 0 | 0 | 0.000 | 45264 | 0 |
106 | rdm | localhost | 19_org | Query | 566 | Waiting for table level lock | /* pid:18256 spd_user: ricardo.sup SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.63 session=mojyc0.m3bw9kyvw9lb94juwjhoo0o0k00sscwoc0 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:41" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 566342.786 | 0 | 0 | 0.000 | 45264 | 0 |
105 | rdm | localhost | 19_org | Query | 527 | Waiting for table level lock | /* pid:17575 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 527510.078 | 0 | 0 | 0.000 | 45264 | 0 |
103 | rdm | localhost | 19_org | Query | 572 | Waiting for table level lock | /* pid:17320 spd_user: tlmk.90652 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=10.10.0.11 session=mojydt.6o1abtr8718qmc4bct5dwcosgsckkkwco4 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:35" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 572365.223 | 0 | 0 | 0.000 | 45264 | 0 |
102 | rdm | localhost | 19_org | Query | 573 | Waiting for table level lock | /* pid:7088 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:33" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 573774.785 | 0 | 0 | 0.000 | 45264 | 0 |
101 | rdm | localhost | 19_org | Query | 575 | Waiting for table level lock | /* pid:7074 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:31" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 575718.327 | 0 | 0 | 0.000 | 45264 | 0 |
100 | rdm | localhost | 19_org | Query | 564 | Waiting for table level lock | /* pid:24551 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 564531.734 | 0 | 0 | 0.000 | 45264 | 0 |
104 | rdm | localhost | 19_org | Query | 560 | Waiting for table level lock | /* pid:26361 spd_user: ger.lima SELF='/rdm-business/app/industria.estoque.spadim' ms=0 ip=10.10.0.8 session=mojyf7.tus5fs5umakn8p0l1n34g84owo0k08k8ck */SELECT SUM( b.quantidade * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_quant,SUM( b.quantidade * b.pecas * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_pecas,SUM( b.quantidade * b.pliq * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_pliq,SUM( b.quantidade * b.pbruto * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_pbruto,SUM( b.quantidade * b.vliq * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_vliq,SUM( b.quantidade * b.vbruto * IF(a.sit_spa='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS ped_compra_vbruto,SUM( IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_quant,SUM( b.pecas * IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_pecas,SUM( b.pliq * IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_pliq,SUM( b.pbruto * IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_pbruto,SUM( b.vliq * IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_vliq,SUM( b.vbruto * IF(b.quant_lib>0,(b.quant_lib-b.quant_rejeitado-b.quant_embarcado),(b.quantidade-b.quant_rejeitado-b.quant_embarcado)) * IF(a.sit_spa!='mov',0,1) * IF(a.saida_entrada='e',1,-1) ) AS compras_vbruto FROM spamov AS a,spamov_itens AS b WHERE (a.distribuidor_tipo,a.distribuidor_id)!=('f',2) AND a.unidade_id=1001 AND a.lote_tipo='c' AND b.unidade_id=a.unidade_id AND b.lote_tipo=a.lote_tipo AND b.lote_spa=a.lote_spa AND b.item_id=67 AND b.item_id_red=724 AND a.compra_cancelada='N' | 560340.831 | 0 | 0 | 0.000 | 143152 | 0 |
99 | rdm | localhost | 19_org | Query | 578 | Waiting for table level lock | /* pid:6256 spd_user: ger.lima SELF='/rdm-business/app/spa.gerente.spadim' ms=-1 ip=10.10.0.18 session=mojydb.xcxcu0ll75xs4kje54u4gocck4c4c8wk8c */SELECT distribuidor_tipo,distribuidor_id,vendedor_tipo,vendedor_id,cliente_tipo,cliente_id,d_pag FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456197 | 578273.374 | 0 | 0 | 0.000 | 45264 | 0 |
98 | rdm | localhost | 19_org | Query | 579 | Waiting for table level lock | /* pid:26372 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-1 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */SELECT distribuidor_tipo,distribuidor_id,vendedor_tipo,vendedor_id,cliente_tipo,cliente_id,d_pag FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 579380.206 | 0 | 0 | 0.000 | 45264 | 0 |
97 | rdm | localhost | 19_org | Query | 580 | Waiting for table level lock | /* pid:17094 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 580302.060 | 0 | 0 | 0.000 | 45264 | 0 |
96 | rdm | localhost | 19_org | Query | 580 | Waiting for table level lock | /* pid:14823 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 580307.834 | 0 | 0 | 0.000 | 45264 | 0 |
95 | rdm | localhost | 19_org | Query | 580 | Waiting for table level lock | /* pid:26358 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 580396.220 | 0 | 0 | 0.000 | 45264 | 0 |
94 | rdm | localhost | 19_org | Query | 580 | Waiting for table level lock | /* pid:16442 spd_user: couto_it_48 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=187.67.55.11 session=mojyf0.7pi5nb51dedoe4hc1v5csw0g4k44os4cos */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:27" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 580257.731 | 0 | 0 | 0.000 | 45264 | 0 |
93 | rdm | localhost | 19_org | Query | 582 | Waiting for table level lock | /* pid:25905 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 582378.637 | 0 | 0 | 0.000 | 45264 | 0 |
92 | rdm | localhost | 19_org | Query | 582 | Waiting for table level lock | /* pid:6590 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 582555.465 | 0 | 0 | 0.000 | 45264 | 0 |
91 | rdm | localhost | 19_org | Query | 578 | Waiting for table level lock | /* pid:6255 spd_user: ppdp01.1 SELF='/rdm-business/app/industria.pdp.spadim' ms=-1 ip=172.16.1.52 session=mojycp.e4qtxa6lja7luma2hqnsw8gwc448skok08 */UPDATE spamov_itens AS a SET quant_produzido=20894,pecas_prod=20894,pliq_prod=459908.45,vliq_prod=0,pbruto_prod=468335.15,vbruto_prod=0 WHERE unidade_id=1001 AND lote_tipo='i' AND lote_spa=75 AND item_id=67 AND item_id_red=89 | 578809.478 | 0 | 0 | 0.000 | 53424 | 0 |
90 | rdm | localhost | 19_org | Query | 582 | Waiting for table level lock | /* pid:17095 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 582765.870 | 0 | 0 | 0.000 | 45264 | 0 |
88 | rdm | localhost | 19_org | Query | 535 | Waiting for table level lock | /* pid:6848 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 535863.507 | 0 | 0 | 0.000 | 45264 | 0 |
86 | rdm | localhost | 19_org | Query | 585 | Waiting for table level lock | /* pid:11408 spd_user: sup.shpak SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=189.106.119.106 session=mojyeq.72d53rqx08uu460bh8pgc0g80s4840s4gk */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:21" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 585508.214 | 0 | 0 | 0.000 | 45264 | 0 |
85 | rdm | localhost | 19_org | Query | 586 | Waiting for table level lock | /* pid:12095 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 586390.666 | 0 | 0 | 0.000 | 45264 | 0 |
84 | rdm | localhost | 19_org | Query | 586 | Waiting for table level lock | /* pid:14821 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 586646.722 | 0 | 0 | 0.000 | 45264 | 0 |
83 | rdm | localhost | 19_org | Query | 586 | Waiting for table level lock | /* pid:6826 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 586880.248 | 0 | 0 | 0.000 | 45264 | 0 |
81 | rdm | localhost | 19_org | Query | 588 | Waiting for table level lock | /* pid:6258 spd_user: v.90577 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=187.13.97.228 session=mojyej.x2x0c7y6n9jn9235fo5c084sg4kgcwok4s */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:19" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 588028.896 | 0 | 0 | 0.000 | 45264 | 0 |
80 | rdm | localhost | 19_org | Query | 588 | Waiting for table level lock | /* pid:12093 spd_user: cesar_it_162 SELF='/rdm-business/app/spa.supervisor.spadim' ms= |
588981.403 | 0 | 0 | 0.000 | 45264 | 0 |
79 | rdm | localhost | 19_org | Query | 589 | Waiting for table level lock | /* pid:24778 spd_user: ricardo.sup SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.63 session=mojyc0.m3bw9kyvw9lb94juwjhoo0o0k00sscwoc0 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:18" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 589459.273 | 0 | 0 | 0.000 | 45264 | 0 |
78 | rdm | localhost | 19_org | Query | 590 | Waiting for table level lock | /* pid:7087 spd_user: tlmk.90635 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=10.10.0.14 session=mojye7.7auzyay75aemolwxt6jkgkkkc48cogsgs8 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:17" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 590276.002 | 0 | 0 | 0.000 | 45264 | 0 |
77 | rdm | localhost | 19_org | Query | 592 | Waiting for table level lock | /* pid:7114 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 592153.944 | 0 | 0 | 0.000 | 45264 | 0 |
76 | rdm | localhost | 19_org | Query | 592 | Waiting for table level lock | /* pid:7109 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 592484.058 | 0 | 0 | 0.000 | 45264 | 0 |
75 | rdm | localhost | 19_org | Query | 592 | Waiting for table level lock | /* pid:24553 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 592643.714 | 0 | 0 | 0.000 | 45264 | 0 |
74 | rdm | localhost | 19_org | Query | 593 | Waiting for table level lock | /* pid:24550 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 593068.672 | 0 | 0 | 0.000 | 45264 | 0 |
73 | rdm | localhost | 19_org | Query | 593 | Waiting for table level lock | /* pid:10504 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-7 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 593511.279 | 0 | 0 | 0.000 | 45264 | 0 |
72 | rdm | localhost | 19_org | Query | 593 | Waiting for table level lock | /* pid:6591 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-7 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 593707.388 | 0 | 0 | 0.000 | 45264 | 0 |
71 | rdm | localhost | 19_org | Query | 594 | Waiting for table level lock | /* pid:10573 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-7 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 594454.280 | 0 | 0 | 0.000 | 45264 | 0 |
69 | rdm | localhost | 19_org | Query | 600 | Waiting for table level lock | /* pid:14824 spd_user: ricardo.sup SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.63 session=mojyc0.m3bw9kyvw9lb94juwjhoo0o0k00sscwoc0 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:06" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 600517.209 | 0 | 0 | 0.000 | 45264 | 0 |
68 | rdm | localhost | 19_org | Query | 601 | Waiting for table level lock | /* pid:6827 spd_user: tlmk.90587 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=10.10.0.13 session=mojydn.lytuzbfeh5h0767z1vx4woo4gkwcsgc8cg */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:35:05" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 601593.594 | 0 | 0 | 0.000 | 45264 | 0 |
66 | rdm | localhost | 19_org | Query | 612 | Waiting for table level lock | /* pid:17300 spd_user: sumye_150 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=4 ip=189.106.12.14 session=mojyc6.9b1fgryx84hw85v4to3y8g0cwwcckkkwgc */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=855174 | 612552.448 | 0 | 0 | 0.000 | 45264 | 0 |
65 | rdm | localhost | 19_org | Query | 613 | Waiting for table level lock | /* pid:7095 spd_user: cesar_it_162 SELF='/rdm-business/app/spa.supervisor.spadim' ms=0 ip=10.10.0.123 session=mojydb.v69u7fsd19o7ll9e811k4w0ko4wkggww44 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:34:54" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 613032.881 | 0 | 0 | 0.000 | 45264 | 0 |
64 | rdm | localhost | 19_org | Query | 614 | Waiting for table level lock | /* pid:7112 spd_user: v.90102 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=-1 ip=200.97.118.126 session=mojyci.emyc19ldicepl5f7fdkgs8w0wcgwkskccc */SELECT distribuidor_tipo,distribuidor_id,vendedor_tipo,vendedor_id,cliente_tipo,cliente_id,d_pag FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456196 | 614033.570 | 0 | 0 | 0.000 | 45264 | 0 |
63 | rdm | localhost | 19_org | Query | 591 | Waiting for table level lock | /* pid:17586 spd_user: ppdp01.1 SELF='/rdm-business/app/industria.pdp.spadim' ms=-1 ip=172.16.1.52 session=mojycp.e4qtxa6lja7luma2hqnsw8gwc448skok08 */UPDATE spamov_itens AS a SET quant_produzido=20893,pecas_prod=20893,pliq_prod=459892.65,vliq_prod=0,pbruto_prod=468318.95,vbruto_prod=0 WHERE unidade_id=1001 AND lote_tipo='i' AND lote_spa=75 AND item_id=67 AND item_id_red=89 | 591891.055 | 0 | 0 | 0.000 | 53424 | 0 |
62 | rdm | localhost | 19_org | Query | 615 | Waiting for table level lock | /* pid:6844 spd_user: v.90023 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=177.192.198.122 session=mojydx.phnx1m2z9cm3c1c4zue8gwocso8kcg0oko */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:34:52" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 615257.836 | 0 | 0 | 0.000 | 45264 | 0 |
60 | rdm | localhost | 19_org | Query | 594 | Waiting for table level lock | /* pid:11403 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-2 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT rest_data_producao,rest_data_vencimento,rest_embarque_processado,rest_contrato FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 594461.783 | 0 | 0 | 0.000 | 45264 | 0 |
59 | rdm | localhost | 19_org | Query | 616 | Waiting for table level lock | /* pid:17284 spd_user: tlmk.90652 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=10.10.0.11 session=mojydt.6o1abtr8718qmc4bct5dwcosgsckkkwco4 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:34:51" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 616195.277 | 0 | 0 | 0.000 | 45264 | 0 |
57 | rdm | localhost | 19_org | Query | 617 | Waiting for table level lock | /* pid:17323 spd_user: vv.90504 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=6 ip=177.179.99.50 session=mojydv.7602kq7qu58o1djtavowswgcw80o0gg4g- */SELECT COUNT AS quant_ped,SUM(quant_itens) AS quant_itens,SUM(cur_oe_quant) AS quant_oe,SUM(valor_total) AS valor_total,SUM(valor_tab) AS valor_tab,SUM(valor_total*dias_medios)/SUM(valor_total) AS dias_medios FROM (SELECT a.lote_spa,a.quant_itens,a.cur_oe_quant,a.valor_total,a.valor_total/(1-(a.desconto_itens/100)) AS valor_tab,a.dias_medios,(SELECT plano_conta_numero FROM rotas WHERE plano_conta_id=a.rota_id AND plano_conta_id_red=a.rota_id_red) AS rota_numero FROM spamov AS a WHERE a.lote_tipo='v' AND a.lote_spa>=0 AND a.lote_spa<=99999999999 AND a.lote_estorno=0 AND a.data_prevista_embarque>='2013-06-01 03:00:00' AND a.data_prevista_embarque<='2013-06-18 02:59:59' AND ((a.distribuidor_tipo,a.distribuidor_id) = ('f',90504) OR (a.gerente_tipo,a.gerente_id) = ('f',90504) OR (a.supervisor_tipo,a.supervisor_id) = ('f',90504) OR (a.vendedor_tipo,a.vendedor_id) = ('f',90504) OR (a.digitador_tipo,a.digitador_id) = ('f',90504) OR (a.cliente_tipo,a.cliente_id) = ('f',90504)) AND sit_spa!='mov' GROUP BY a.unidade_id,a.lote_tipo,a.lote_spa) AS tmp_tbl | 617795.898 | 0 | 0 | 0.000 | 94216 | 0 |
56 | rdm | localhost | 19_org | Query | 617 | Waiting for table level lock | /* pid:17583 spd_user: v.90651 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=189.24.25.108 session=mojycs.1m2h9ik1n1oi7xgyxae1w8owcoo08s44g0 */SELECT MAX(a) FROM (SELECT MAX(lote_spa) AS a FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' UNION SELECT MAX(orcamento_numero) AS a FROM spamov WHERE unidade_id=1001 AND lote_tipo='v') AS b | 617246.108 | 0 | 0 | 0.000 | 61584 | 0 |
54 | rdm | localhost | 19_org | Query | 613 | Waiting for table level lock | /* pid:16096 spd_user: iran_it_34 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=187.105.76.118 session=mojycy.wttbnebrnemc8u418r6okg0k0w00ogwk08 */UPDATE spamov_digitacao SET data_prevista_embarque="2013-06-17 16:34:54" WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=0 | 613373.215 | 0 | 0 | 0.000 | 45264 | 0 |
51 | rdm | localhost | 19_org | Query | 615 | Waiting for table level lock | /* pid:6850 spd_user: ger.lima SELF='/rdm-business/app/spa.gerente.spadim' ms=-1 ip=10.10.0.18 session=mojydb.xcxcu0ll75xs4kje54u4gocck4c4c8wk8c */SELECT distribuidor_tipo,distribuidor_id,vendedor_tipo,vendedor_id,cliente_tipo,cliente_id,d_pag FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456197 | 615402.782 | 0 | 0 | 0.000 | 45264 | 0 |
50 | rdm | localhost | 19_org | Query | 613 | Waiting for table level lock | /* pid:7107 spd_user: ricardo.sup SELF='/rdm-business/app/spa.supervisor.spadim' ms=6 ip=10.10.0.63 session=mojyc0.m3bw9kyvw9lb94juwjhoo0o0k00sscwoc0 */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456192 | 613791.678 | 0 | 0 | 0.000 | 45264 | 0 |
46 | rdm | localhost | 19_org | Query | 609 | Waiting for table level lock | /* pid:11409 spd_user: v.90102 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=200.97.118.126 session=mojyci.emyc19ldicepl5f7fdkgs8w0wcgwkskccc */SELECT data_prevista_embarque,data_prevista_chegada,data_prevista_processo,sit_spa FROM spamov_digitacao WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456196 | 609239.144 | 0 | 0 | 0.000 | 45264 | 0 |
45 | rdm | localhost | 19_org | Query | 610 | Waiting for table level lock | /* pid:12089 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=-1 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT valor_un_pg,valor_tabela_grandeza_un,valor_tabela_grandeza_qnt FROM spamov_itens WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 AND item_id=67 AND item_id_red=724 | 610088.094 | 0 | 0 | 0.000 | 45264 | 0 |
29 | rdm | localhost | 19_org | Query | 611 | Waiting for table level lock | /* pid:6593 spd_user: v.90577 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=187.13.97.228 session=mojyce.mhxsgi66bft9qotcblkw4g084000w00o8- */SELECT b.valor_un_pg FROM spamov_itens AS b,spamov AS c WHERE b.lote_spa!=1456189 AND (b.unidade_id,b.lote_tipo,b.lote_spa)=(c.unidade_id,c.lote_tipo,c.lote_spa) AND b.item_id=67 AND b.item_id_red=447 AND c.unidade_id=1001 AND c.lote_tipo='v' AND c.cliente_tipo='j' AND c.cliente_id=25208 ORDER BY c.lote_spa DESC LIMIT 1 | 611446.794 | 0 | 0 | 0.000 | 53424 | 0 |
28 | rdm | localhost | 19_org | Query | 606 | Waiting for table level lock | /* pid:6257 spd_user: ger.lima SELF='/rdm-business/app/spa.gerente.spadim' ms=0 ip=10.10.0.9 session=mojyd5.wksprbkj3bo5d92mtf5s00080s4ccss8wg */SELECT b.valor_un_pg FROM spamov_itens AS b,spamov AS c WHERE b.lote_spa!=854797 AND (b.unidade_id,b.lote_tipo,b.lote_spa)=(c.unidade_id,c.lote_tipo,c.lote_spa) AND b.item_id=67 AND b.item_id_red=854 AND c.unidade_id=1001 AND c.lote_tipo='v' AND c.cliente_tipo='f' AND c.cliente_id=43943 ORDER BY c.lote_spa DESC LIMIT 1 | 606858.040 | 0 | 0 | 0.000 | 53424 | 0 |
24 | rdm | localhost | 19_org | Query | 562 | Waiting for table level lock | /* pid:10502 spd_user: ppdp01.1 SELF='/rdm-business/app/industria.pdp.spadim' ms=-1 ip=172.16.1.52 session=mojycp.e4qtxa6lja7luma2hqnsw8gwc448skok08 */UPDATE spamov_itens AS a SET quant_produzido=20895,pecas_prod=20895,pliq_prod=459932.75,vliq_prod=0,pbruto_prod=468359.85,vbruto_prod=0 WHERE unidade_id=1001 AND lote_tipo='i' AND lote_spa=75 AND item_id=67 AND item_id_red=89 | 562494.182 | 0 | 0 | 0.000 | 53424 | 0 |
49 | rdm | localhost | 19_org | Query | 617 | Waiting for table level lock | /* pid:15051 spd_user: v.90067 SELF='/rdm-business/app/spa.supervisor.spadim' ms=0 ip=10.10.0.38 session=mojyd7.ufyxq3c3n6ny4b9487e04o0skg4kw4gg4o */UPDATE spamov_digitacao SET margem_itens=158.50340136054,dias_medios=7,comissao_valor=0.00,comissao_basecalculo=182.40,valor_total_sem_desc=182.4,valor_total_sem_desc_nf=182.4,valor_total=182.4,valor_total_nf=182.4,impostos_retidos=0,quant_itens=1,pecas=1,vbruto=0,vliq=0,pbruto=24,pliq=24,desconto_itens=-1.4686248331108,desconto_sobre_pedido=0.00,desconto_sobre_pedido_por='0',moeda="R$",moeda_fator=1,icms_basecalculo=0.00,icms_valor=0.00,icms_subst_basecalculo=0.00,icms_subst_valor=0.00,ipi_basecalculo=182.40,ipi_valor=0.00,iss_basecalculo=182.40,iss_valor=0.00 WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456194 | 617114.366 | 0 | 0 | 0.000 | 61584 | 0 |
48 | rdm | localhost | 19_org | Query | 619 | Copying to tmp table | /* pid:18029 spd_user: adm.jn SELF='/rdm-business/app/industria.pcp.spadim' ms=7 ip=10.10.0.26 session=mojydk.kz8frkrnm8ki220duxhk4kkwcwk8gw4osg */SELECT a.unidade_id,a.lote_spa,a.lote_tipo,a.vendedor_tipo,a.vendedor_id,a.cliente_tipo,a.cliente_id,a.sit_producao,SUM(b.cur_op_quant) AS cur_op_quant,SUM(b.cur_op_quant*b.vliq) AS cur_op_volume_liq,SUM(b.cur_op_quant*b.pliq) AS cur_op_peso_liquido,b.cur_op,b.cur_op_seq,a.sit_pcp,b.item_id,b.item_id_red,b.cur_oe FROM spamov_itens AS b, spamov AS a WHERE b.unidade_id=a.unidade_id AND b.lote_tipo=a.lote_tipo AND b.lote_spa=a.lote_spa AND a.unidade_id IN ("1001") AND a.abate='N' AND a.lote_tipo IN ('v') AND b.cur_op_quant>0 AND a.producao="Y" AND sit_pcp="mov" AND a.lote_spa>=0 AND a.lote_spa<=99999999999 AND a.cur_oe>=0 AND a.cur_oe<=99999999999 AND b.cur_op=0 AND a.data_digitacao>='2000-01-01 02:00:00' AND a.data_digitacao<='2013-06-18 02:59:59' GROUP BY b.unidade_id,b.item_id,b.item_id_red ORDER BY b.item_id ASC,b.item_id_red ASC | 619676.104 | 0 | 0 | 0.000 | 1162208 | 0 |
47 | rdm | localhost | 19_org | Query | 617 | Waiting for table level lock | /* pid:17097 spd_user: tlmk.90634 SELF='/rdm-business/app/spa.vendedorexterno.spadim' ms=0 ip=10.10.0.12 session=mojydd.vztreb8f46mkbytxrlmw4ws488swowoko4 */UPDATE spamov_digitacao SET margem_itens=61.751292186075,dias_medios=7,comissao_valor=0.00,comissao_basecalculo=319.20,valor_total_sem_desc=319.2,valor_total_sem_desc_nf=319.2,valor_total=319.2,valor_total_nf=319.2,impostos_retidos=0,quant_itens=2,pecas=2,vbruto=72.384,vliq=0,pbruto=43.96,pliq=42,desconto_itens=-1.4686248331108,desconto_sobre_pedido=0.00,desconto_sobre_pedido_por='0',moeda="R$",moeda_fator=1,icms_basecalculo=0.00,icms_valor=0.00,icms_subst_basecalculo=0.00,icms_subst_valor=0.00,ipi_basecalculo=319.20,ipi_valor=0.00,iss_basecalculo=319.20,iss_valor=0.00 WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456195 | 617150.006 | 0 | 0 | 0.000 | 61584 | 0 |
41 | rdm | localhost | 19_org | Query | 617 | Waiting for table level lock | /* pid:15052 spd_user: cesar_it_162 SELF='/rdm-business/app/spa.supervisor.spadim' ms=0 ip=186.241.142.146 session=mojyd5.x9plf2s4atgb534arcwkkkkkgkskogks-- */UPDATE spamov AS a SET cur_oe_quant=(SELECT SUM(cur_oe_quant) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_oe_pecas=(SELECT SUM(cur_oe_quant*pecas) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_oe_vbruto=(SELECT SUM(cur_oe_quant*vbruto) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_oe_vliq=(SELECT SUM(cur_oe_quant*vliq) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_oe_pbruto=(SELECT SUM(cur_oe_quant*pbruto) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_oe_pliq=(SELECT SUM(cur_oe_quant*pliq) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa),cur_op_quant=(SELECT SUM(cur_op_quant) FROM spamov_itens WHERE unidade_id=a.unidade_id AND lote_tipo='v' AND lote_spa=a.lote_spa) WHERE unidade_id=1001 AND lote_tipo='v' AND lote_spa=1456193 | 617865.831 | 0 | 0 | 0.000 | 110528 | 0 |
20 | rdm | localhost | 19_org | Query | 610 | Waiting for table level lock | /* pid:7075 spd_user: valinho15 SELF='/rdm-business/app/spa.supervisor.spadim' ms=0 ip=189.48.71.90 session=mojycn.sdik1xdj7ble044m8z6og8skcsc08sccwg */SELECT b.valor_un_pg FROM spamov_itens AS b,spamov AS c WHERE b.lote_spa!=1456188 AND (b.unidade_id,b.lote_tipo,b.lote_spa)=(c.unidade_id,c.lote_tipo,c.lote_spa) AND b.item_id=67 AND b.item_id_red=486 AND c.unidade_id=1001 AND c.lote_tipo='v' AND c.cliente_tipo='j' AND c.cliente_id=43888 ORDER BY c.lote_spa DESC LIMIT 1 | 610073.046 | 0 | 0 | 0.000 | 53424 | 0 |
16 | rdm | localhost | 19_org | Query | 611 | Waiting for table level lock | /* pid:11641 spd_user: ppdp01.1 SELF='/rdm-business/app/industria.pdp.spadim' ms=-1 ip=172.16.1.52 session=mojycp.e4qtxa6lja7luma2hqnsw8gwc448skok08 */UPDATE spamov_itens AS a SET quant_produzido=17966,pecas_prod=22492,pliq_prod=384447.66,vliq_prod=0,pbruto_prod=391856.71,vbruto_prod=0 WHERE unidade_id=1001 AND lote_tipo='i' AND lote_spa=75 AND item_id=67 AND item_id_red=403 | 611401.036 | 0 | 0 | 0.000 | 53424 | 0 |
3 | rdm | localhost | 19_org | Query | 519 | Waiting for table level lock | /* pid:6592 spd_user: ppde4.1 SELF='/rdm-business/app/industria.pde.spadim' ms=8 ip=172.16.1.57 session=mojycq.urcufh8qq4fx5hre85h2cc08s48k8k0sss */SELECT cur_oe,cur_oe_seq FROM spamov WHERE unidade_id=1001 AND lote_tipo='c' AND lote_spa=27521 | 519066.150 | 0 | 0 | 0.000 | 45264 | 0 |
Attachments
Issue Links
- is part of
-
MDEV-4704 PROCESSLIST - Query Rank execution order
- Open