Informix

 View Only
  • 1.  Help to understand this sqexplain

    Posted Thu July 21, 2022 10:32 AM
      |   view attached
    Hello,
    I have this query that is taking many hours to run.
    I made a setexplain of it but I can't understand where the problem is.
    I believe I should create some table indices but I don't know which tables

    ------------------------------
    Leandro Kohler
    ------------------------------

    #Informix

    Attachment(s)

    out
    sqexplain.out   404 KB 1 version


  • 2.  RE: Help to understand this sqexplain

    IBM Champion
    Posted Thu July 21, 2022 10:38 AM

    Maybe post the plan ?

     






  • 3.  RE: Help to understand this sqexplain

    Posted Thu July 21, 2022 10:42 AM
    Hi Paul, its attached

    ------------------------------
    Leandro Kohler
    ------------------------------



  • 4.  RE: Help to understand this sqexplain

    Posted Thu July 21, 2022 10:45 AM
    QUERY
    -----------------------------------------------------------------

    SELECT eis_v_cap_despesas.cod_empresa cod_empresa, SUM(eis_v_cap_despesas.val_tot_nf) val_tot_nf,eis_v_cap_despesas.den_nivel_2 den_nivel_2,eis_v_cap_despesas.den_nivel_4 den_nivel_4,eis_v_cap_despesas.raz_social raz_social,eis_v_cap_despesas.ano_mes ano_mes, SUM(eis_v_cap_despesas.valor) valor
    from eis_v_cap_despesas eis_v_cap_despesas
    WHERE 1=1
    AND ((eis_v_cap_despesas.dat_pgto >= '07/01/2022' and eis_v_cap_despesas.dat_pgto <= '07/31/2022' ) and eis_v_cap_despesas.num_conta_contabil = '8.1000.04.09') --,'8.1100.04.10','10000409','11000410' ))
    GROUP BY eis_v_cap_despesas.cod_empresa,eis_v_cap_despesas.den_nivel_2,eis_v_cap_despesas.den_nivel_4,eis_v_cap_despesas.raz_social,eis_v_cap_despesas.ano_mes



    OUTPUT SETEXPLAIN: attached on post


    ------------------------------
    Leandro Kohler
    ------------------------------



  • 5.  RE: Help to understand this sqexplain

    Posted Thu July 21, 2022 11:01 AM

    Leandro,

     

     

    Many people receive those messages thru email and have either no time  nor possibility to log into a webpage.

     

    So please post the query plan in the message and not as attached document if you want more people look at it ��

     

    Thanks

    Eric

     






  • 6.  RE: Help to understand this sqexplain

    IBM Champion
    Posted Thu July 21, 2022 11:19 AM
    Eric - this one you don't wanna see here as a post ;-)

    ------------------------------
    Andreas Legner
    ------------------------------