Antoine_Sauteron_1266

SQL statements against EH table causing latency

Discussion created by Antoine_Sauteron_1266 on Dec 2, 2016
Latest reply on Dec 9, 2016 by Antoine_Sauteron_1266
Can you please check and revert what is query doing and why running in multiple parallels causing high concurrency

SELECT  EH_Queue                   ,
        COUNT(EH_Status) DIVDB_INT4,
        EH_Status DIVDB_String     ,
        EH_Client
FROM
        (
                SELECT  EH_Queue ,
                        EH_Client,
                        CASE
                                WHEN EH_Status BETWEEN 1800 AND 1899
                                THEN 'a'
                                WHEN EH_Status IN (1560,1561,1562,1563,1564)
                                THEN 'b'
                                WHEN EH_Status BETWEEN 1300 AND 1599
                                THEN 'r'
                                WHEN EH_Status BETWEEN 1600 AND 1799
                                THEN 'w'
                                ELSE 'x'
                        END AS EH_Status
                FROM    EH
                WHERE   EH_Client = :A0001
        )
        eh
GROUP BY EH_Queue,
        EH_Status,
        EH_Client
ORDER BY EH_Queue
It seems this query retrieves and arranges information from table EH. This table contains the information which can be seen in the "Activities" window. As table EH is constantly being refreshed with INSERT and DELETE commands (because of activities), running a SELECT against it can take some time, especially if you are running multiple concurrent queries.

Outcomes