I have an application developed to generate reports the language that was used was C sharp, this application connects to a MySQL DB in a server that is inside the same network, the reports are generated by parameters of date and time, At the moment of consulting a specific parameter (more than 3 days) the application hangs up, we try modifying the date parameter to only 1 day and the system generates the report, so the problem seems to be the amount of data generated by the Parameters of date and time, we also tried to generate the query data directly from the server terminal, it took a while but the query was generated correctly, we are generating this query directly in the application where the report is generated, we already have several days looking for a solution to this problem, so I will advise any advice. I enclose the query that generates the report:
SELECT FECHAHORA, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE1' THEN ROUND(VALOR,2) END) AS B1, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE2' THEN ROUND(VALOR,2) END) AS B2, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE3' THEN ROUND(VALOR,2) END) AS B3, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE4' THEN ROUND(VALOR,2) END) AS B4, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE5' THEN ROUND(VALOR,2) END) AS B5, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE6' THEN ROUND(VALOR,2) END) AS B6, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE7' THEN ROUND(VALOR,2) END) AS B7, SUM(DISTINCT CASE WHEN NOMBRE = 'NOMBRE8' THEN ROUND(NOMBRE,2) END) AS B8 FROM DATOSDT, CONFIGURACION WHERE DATOSDT.ID = CONFIGURACION.ID AND FECHAHORA BETWEEN '2018-02-05 06:00:00' AND '2018-02-10 18:00:00' GROUP BY FECHAHORA;
I appreciate your time and attention.
Greetings.