Skip to Content
avatar image
Former Member

package size in select statement

Hi Experts,

In my program i have 4 select statements.

in first select i am getting 6 lacks records.

2nd select i am getting 5 lacks records.in this statement i am using for all entries in above table.

3 rd select i am getting 99 lacks records in this statement i am using for all enries in 2 nd internal table

4th select i am getting 5 lacks records in this statement i am using for all entries in 3rd internal table.

select f1 f2 f3 from database table into internal table

package sige 10000

for all.......

where ..........

append lines of internal table to final internal table.

refresh internal table.

Endselect.

i am following this way..

if i follow like this it will improve my program performence.

or is there any other way to improve my program performence.

please any body answer my question its very urgent.

thanks in advance.

Tharangini.K

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • May 29, 2008 at 08:09 AM

    Try to use one join.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 29, 2008 at 08:10 AM

    Hi,

    using package size will restrcit the data entries during the fetch. it will pullout the data in chunks. it will help improving the performance. why dont u avoid select-end select. instead append the data into final internal table once the data selection is over!! and since you are retrieving large data, keep your memory usage in optimal level. free the internal table once process (using that int. table) is over.

    regards,

    madhu

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      select f1 f2 .... from dbtable

      appending corresponding fields of table internal table

      package size 10000

      where ......

      endselect.

      select f1 f2 .... from dbtable

      into corresponding fields of table internal table

      package size 10000

      where ......

      append lines of internal table to final internal table

      free internal.

      endselect.

      which method is best one.

      please tell me quickly.

      Thanks,

      Tharangini

  • May 29, 2008 at 11:30 AM

    again why don't you use a join!

    I don't think that the for all entries will work with the package size. The FAE read duplicates internediately but takes care that there are no duplicates at the end. This can not work with a package size.

    Your selects are very large, the FAE works only small blocks so it will be anyway slow.

    If you can program it with a join the solution can be faster by several orders, i.e factor 100 or 1000!

    A FAE is only in exceptional cases better than a join, that are the cases where the optimizer is confused and chooses the wrong index for one or more tables of the join. In most cases it should work. To decide it, the details are necessary.

    Read my blogs and you will see, that I know what I am talking about.

    Siegfried

    Add comment
    10|10000 characters needed characters exceeded