Skip to Content


I am considering using GROUP BY in several selects where I will access very big bsik, bsid, bsad, bsak, ecc...

My two concerns are performance and high data volume.

GROUP BY should reduce data arriving from DB but will it hurt performance?

What are your considerations?

Any ideas are welcome. I cannot seem to find anything specific for or against GROUP BY.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2005 at 09:48 AM

    Hello Philip,

    I would advise that you do not use the Group By clause in the select statements for these tables. As you have rightly said, the data volume in these tables might be a major cause for concern.

    Using the Group By clause will heavily load the database server. while in the development environment, your query might run okay, in the productive environment it might crash. The reason : the cursor to the database would have timed out.

    The Group By operation, as you know can be simulated after you get the data into the application server. The application server processing can take some time but you can usually optimize it.


    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 02, 2005 at 12:59 PM

    Hi Phillip,

    good to hear you go for an other way.

    IMHO GROUP BY makes sense only with aggregations (like COUNT( * ), MAX( LFDNR ),...). Then grouping will bring you a bunch of counts, which would otherwise have to be selected step by step.

    That's hard work for database, but faster then getting all entries and looping + counting on application server (in general, depends of course on factor (total number of entries) / (number of groups) ).

    In your situation, you most likely need all entries anyway.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.