#1
|
|||
|
|||
rendimiento
Hola.
tengo una seleccion de tres tablas EKKO-EKPO-EKET, he hecho la seleccion haciendo un INNER JOIN y un FOR ALL ENTRIES pero la selección tarda tanto que me da un error por tiempo. La sentecia es: SELECT k~ekorg k~ekgrp k~lifnr k~konnr p~ebeln p~ebelp p~matkl p~matnr p~txz01 p~werks p~knttp p~meins t~etenr t~menge t~eindt t~yyretraso t~yypinsp t~yyfinsp t~yyestadoinsp t~yyagencia t~yyinforme t~yycant_insp t~yycant_defect t~yyobserv t~yyresult_insp INTO CORRESPONDING FIELDS OF TABLE t_yv_pinsp FROM ekko AS k INNER JOIN ekpo AS p ON k~ebeln = p~ebeln INNER JOIN eket AS t ON p~ebeln = t~ebeln ON p~ebelp = t~ebelp FOR ALL ENTRIES IN t_matkl WHERE p~matkl = t_matkl-matkl AND k~lifnr IN so_lifnr AND k~lifnr NOT BETWEEN '100' AND '300' AND p~werks IN so_werks AND p~loekz = ' ' AND p~bstyp EQ 'F' AND p~matkl IN so_maktl AND t~eindt IN r_periodo AND ( k~ebeln BETWEEN '4207000000' AND '42999999999' OR k~ebeln BETWEEN '4607000000' AND '46999999999' OR k~ebeln BETWEEN '4307000000' AND '43999999999' ). Hay alguna manera de mejorar el rendimiento. |
#2
|
||||
|
||||
Hola, trata de probarlo de esta forma, colocando un rango y el parametro ebeln al comienzo de la consulta, espero sirva
RANGES: lr_ebeln FOR ekko-ebeln. lr_ebeln-sign = 'I'. lr_ebeln-option = 'BT'. lr_ebeln-low = '4207000000'. lr_ebeln-high = '4299999999'. APPEND lr_ebeln. lr_ebeln-low = '4307000000'. lr_ebeln-high = '4399999999'. APPEND lr_ebeln. lr_ebeln-low = '4607000000'. lr_ebeln-high = '4699999999'. APPEND lr_ebeln. SELECT k~ekorg k~ekgrp k~lifnr k~konnr p~ebeln p~ebelp p~matkl p~matnr p~txz01 p~werks p~knttp p~meins t~etenr t~menge t~eindt t~yyretraso t~yypinsp t~yyfinsp t~yyestadoinsp t~yyagencia t~yyinforme t~yycant_insp t~yycant_defect t~yyobserv t~yyresult_insp INTO CORRESPONDING FIELDS OF TABLE t_yv_pinsp FROM ekko AS k INNER JOIN ekpo AS p ON k~ebeln = p~ebeln INNER JOIN eket AS t ON p~ebeln = t~ebeln ON p~ebelp = t~ebelp FOR ALL ENTRIES IN t_matkl WHERE k~ebeln IN lr_ebeln AND p~matkl = t_matkl-matkl AND k~lifnr IN so_lifnr AND k~lifnr NOT BETWEEN '100' AND '300' AND p~werks IN so_werks AND p~loekz = ' ' AND p~bstyp EQ 'F' AND p~matkl IN so_maktl AND t~eindt IN r_periodo.
__________________
David Carballido Córdova |
Herramientas | Buscar en Tema |
Desplegado | |
|
|