2014 Mar 12 7:53 AM
Hi All,
I was using select- edselect with package size but i have hard coding the package size. Can any one tell me the the process to determine dynamic package size so that i can use in parallel processing.
2014 Mar 12 8:09 AM
Usually package size is used to avoid memory overflow when mass-reading data, or to insert occasional commit works when mass-updating data.
Your best bet here is to have the package size as a selection parameter that can be adjusted if needed.
But how do package size and parallel processing go together? How do you avoid that the same data is being selected by processes running in parallel? I think you rather need to prepare "smart" selection ranges for this purpose.
Please tell us what your requirement is.
Thomas
2014 Mar 12 8:01 AM
I don't think there is anyway to deteermine package size dynamically. You will have to use trial and error approach to get optimize package size.
On what basis you want to make package size dynamic?
Regards,
Jigar Thakkar.
2014 Mar 12 8:09 AM
Usually package size is used to avoid memory overflow when mass-reading data, or to insert occasional commit works when mass-updating data.
Your best bet here is to have the package size as a selection parameter that can be adjusted if needed.
But how do package size and parallel processing go together? How do you avoid that the same data is being selected by processes running in parallel? I think you rather need to prepare "smart" selection ranges for this purpose.
Please tell us what your requirement is.
Thomas
2014 Mar 12 9:31 AM
I believe you are able to do what is required. I can imagine one select, which will work in just single program:
1. determine "best" package size may vary on the number of parallel processes needed, so I will imagine, you need 10. Then there is one redundant select statement needed just to count the number of rows that the select will fetch.
2. using a wise modulo statement will split the number to 10 packages, which seems quite dynamic to me . Just do not forget to raise the final package size to a higher number (because the state of the database could change from the first select.
3. by paralel processing, Andy could mean "starting a new task" or "background task" or whatever. So you can have the dynamics and paralel processing at once.
2014 Mar 12 9:36 AM
I rather understood "package size" as being the addition of that name of the "select" statement.
As so often, it is up to the original poster to clarify, and another example for meager initial information leading to guessing games.
Thomas
2014 Mar 12 9:59 AM
I know I should wait for the poster, but I'm quite unsure - what is the difference between my view on the package size and yours?
2014 Mar 12 10:11 AM
I would need to understand your view better to make a good call.
PACKAGE SIZE as the option of the SELECT statement works as a compromise between a huge SELECT INTO TABLE itab (without packages) and a SELECT INTO wa / ENDSELECT loop.
So you still have an SELECT / ENDSELECT loop within the same work process.
I don't see how this relates to parallel processing. What you are referring to seems to be the typical preparation task for parallel processing, creating evenly sized work packages and then kicking off one process per package.
Thomas
2014 Mar 12 10:28 AM
ok, you got it right and now I got it right too. Let's see Andy's move
2014 Mar 12 1:04 PM
I'm running out of Sudokus...do you think he is ever coming back?
2014 Mar 12 1:42 PM
Dude, I gotch. I am using Workplace availability FM and calculated the no of instance for paraalel processing using that i have calculated Package size. It is working right now. Not sure will it run in future
2014 Mar 13 9:29 AM
Can you tell as the detail, what do you mean by Workplace availability FM?
If your problem is solved, why not closing the thread?
2014 Mar 12 8:22 AM
It depends entirely on the SELECT actual statement, you must have already executed a first select statement giving some range of values in an internal table, so you could sort and divide the internal table by the number of process and execute the next statements on every subset in a different process (e.g. with a FAE in itab or using lowest/highest value of key values in subset itab)
Regards,
Raymond
2014 Mar 12 8:23 AM
Hi,
If you are looking to determine or set the value of package size dynamically then use below code for reference.
DATA: itab TYPE TABLE OF spfli,
wa like LINE OF itab,
n TYPE i.
n = 10.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE itab
PACKAGE SIZE n.
LOOP AT itab INTO wa.
WRITE: / wa-carrid, wa-connid.
ENDLOOP.
ENDSELECT.
If you are concerned about the performance then either use SELECT with OPEN CURSOR and CLOSE CURSOR.
Let me know if it helped?
Regards,
Zuber
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |