|
View previous topic :: View next topic
|
| Author |
Message |
a_khedekar
New User
Joined: 21 Dec 2003 Posts: 7
|
|
|
|
Hi All,
Need a suggestion from performance point of view.
This is DB structure.
A (parent)
---> B (Child of A)
---> C (child of C1)
To load all into the a table, Code does the following:
1. GU A= A1, this returns value of key of B
2. To get to B, GNP where A= A1 and B= B1, retrieve B
3. To get to C, GNP where A= A1 and B = B1, retrieve C
I know that we do not require qualified call, as function of GNP is to retrieve the next segment within the set parent.
Does this cause any in-efficiency in the code ?
please let me know
Thanks |
|
| Back to top |
|
 |
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Why use GNP? I do not like them - if you really need an explanation, I will provide one. It is much more efficient and easier to qualify your SSA structure down the chain.
| Quote: |
To load all into the a table, Code does the following:
1. GU A= A1, this returns value of key of B
2. To get to B, GNP where A= A1 and B= B1, retrieve B
3. To get to C, GNP where A= A1 and B = B1, retrieve C |
Some is missing here. How can A return the key value of B? You need to also take into consideration that a child segment is a child segment because it is a 1 to many scenario. In other words - you will have 1 root - A - and a possibility of many B segments. Then under each B segment, you have a possibility of many C segments. What are you trying to accomplish?
1. GU A
2. To get to B - use qualified A SSA and unqualified B SSA and loop until GE or GB (don't need to check for GK, etc)
3. Once you have a good B segment returned you will have a C segment loop executed from your B segment loop - use qualified A SSA and qualified B SSA and unqualified C SSA loop until GE or GB (don't need to check for GK, etc) |
|
| Back to top |
|
 |
a_khedekar
New User
Joined: 21 Dec 2003 Posts: 7
|
|
|
|
I think i didnt use the terms correctly..
My whole question is all about the way you are retrieving all the segments. I want to know is it necessary to use qualified A SSA in step 2 and 3.
Is that performance effective ?
Once we setup parentage by GU A. All what we need it GNP unqualified B.
and GNP unqualified C within B.
I didnt get why are you saying "Why use GNP ?". What are you considering for unqualified B SSA in step 2 or unqualified C SSA in step 3 ? are you considering GN ?
In the end, all i have to do is retrieve all B, C in their hierarchical order for selected A for which key is known.
- Atul |
|
| Back to top |
|
 |
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
| It takes much more to use GNP - way back in my early years of IMS, I did use GNP. From extensive experience, I found it better to qualify the parent segment and use unqualified for any child segments. Of course you would use GN. The example I gave is the easiest. |
|
| Back to top |
|
 |
Ajay Baghel
Active User
.jpg)
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Hi Sandy,
| Quote: |
| From extensive experience, I found it better to qualify the parent segment and use unqualified for any child segments. Of course you would use GN. |
We would like to know if it is a performance issue or some overhead, because of which you do not prefer GNP. Can you throw some light on this please?
Thanks
Ajay |
|
| Back to top |
|
 |
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
| Use whatever you want.......if you already know the answers - don't ask! |
|
| Back to top |
|
 |
Ajay Baghel
Active User
.jpg)
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
| Quote: |
| Use whatever you want.......if you already know the answers - don't ask! |
This is so rude way to answer for such a polite request. |
|
| Back to top |
|
 |
|
|