1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Progress-4GL - What is the fastest way to summarize tables? (Aggregate Functions: Count, Sum...

Discussão em 'StackOverflow' iniciado por fdantas, Dezembro 14, 2018.

  1. fdantas

    fdantas Administrator Moderador

    We are using OpenEdge 10.2A, and generating summary reports using progress procedures. We want to decrease the production time of the reports.

    Since using Accumulate and Accum functions are not really faster than defining variables to get summarized values, and readibility of them is much worse, we don't really use them.

    We have tested our data using SQL commands using ODBC connection and results are much faster than using procedures.

    Let me give you an example. We run the below procedure:

    DEFINE VARIABLE i AS INTEGER NO-UNDO.

    ETIME(TRUE).
    FOR EACH orderline FIELDS(ordernum) NO-LOCK:
    ASSIGN i = i + 1.
    END.
    MESSAGE "Count = " (i - 1) SKIP "Time = " ETIME VIEW-AS ALERT-BOX.


    The result is:

    Count= 330805
    Time= 1891


    When we run equivalent SQL query:

    SELECT count(ordernum) from pub.orderline


    The execution time is 141.

    In short, when we compare two results; sql time is more than 13 times faster then procedure time.

    This is just an example. We can do the same test with other aggregate functions and time ratio does not change much.

    And my question has two parts;

    1-) Is it possible to get aggregate values using procedures as fast as using sql queries?

    2-) Is there any other method to get summarized values faster other than using real time SQL queries?

    Continue reading...

Compartilhe esta Página