![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I posted this on U@UG, but so far, nothing: I believe I'm up to speed on most other platforms' use of BASIC internal selects, but I haven't seen anything conclusive for Universe. We are using a lot of external selects to avoid the "problem" (I think it's a myth) of updating/deleting with an internal select, having the group shuffle underneath those selects, then experiencing either data corruption or unexpected results. AFAIK, these days, the only caveat for avoiding internal selects is if you change the ID, and it gets written into a subsequent group and then re-selected (unwantedly). Are there any Universe internals gurus out there who can shed some compelling light on this subject? I want to take this to the bosses and stop traversing the files twice if we don't have to. (Actually, I think both methods traverse twice - but the internal method is much more likely to select and read a frame without having it flushed between the select and the read.) Thanks for your time. Ed |
#3
| |||
| |||
|
|
Well, depending on WHAT you are doing with the select list, you could always have the best of both worlds !?!? If you are considering an internal select, I'm assuming "order" isn't important (perhaps you are building a temporary summary file from a detail ?). Anyway, you could always harness the "Drumheller Trick" and have an I-type that actually does the "work" - fire off a select (or SSelect, LIST etc) & then simply reference the dictionary item --> one pass through the file PLUS the 'expressiveness' of TCL/ACCESS Same sort of thing can be done with any mv flavout these days that supports some mechanism for calling Basic code from a dictionary. AFAIK, the internal select does NOT traverse twice ... simply has a pointer into a group (starts at base of file), and move through records in current frame, when exhausted goes to next frame etc --> 1 pass, quite quick. Need to be "careful" though - there was a thread on jbase group in last 6 months that indicated some "tuneables" that could actually cause the sorts of problems with group shuffling that you are talking about Ed Sheehan wrote: I posted this on U@UG, but so far, nothing: I believe I'm up to speed on most other platforms' use of BASIC internal selects, but I haven't seen anything conclusive for Universe. We are using a lot of external selects to avoid the "problem" (I think it's a myth) of updating/deleting with an internal select, having the group shuffle underneath those selects, then experiencing either data corruption or unexpected results. AFAIK, these days, the only caveat for avoiding internal selects is if you change the ID, and it gets written into a subsequent group and then re-selected (unwantedly). Are there any Universe internals gurus out there who can shed some compelling light on this subject? I want to take this to the bosses and stop traversing the files twice if we don't have to. (Actually, I think both methods traverse twice - but the internal method is much more likely to select and read a frame without having it flushed between the select and the read.) Thanks for your time. Ed |
#4
| |||
| |||
|
|
Ed, I think it is a myth too. Back in R83 & AP days, I had a some basic utilities that were replacements for istat, but displayed results as each group was traversed, rather than waiting until the end of file is reached to display the results of the first and subsequent groups (which can be a really long time on a big file). These programs worked by interrogating the select list variable, e.g. open "file" to fv select fv to list loop ?? = list<1 ?? = list<2 etc readnext id from list else exit repeat The stuff in list is partly in hex (the file base, the current group, etc) and partly a list of ids in the next group; as each group is used up the next group is read in. Unfortunately, the internal dynamics of this select list variable kept changing in D3 versions, thus my utilities stopped working and I lost interest in the reverse engineering process. But the point is, for R83, AP, D3 and the like, a basic internal select grabs the item-ids one group at a time; writing back to the current group may shuffle the order of items in the group, but does not affect the ids from the group in the select list variable, which were all read in once when the new group was first encountered. I have to believe that the U2 products work the same way. Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 Ross Ferris wrote: Well, depending on WHAT you are doing with the select list, you could always have the best of both worlds !?!? If you are considering an internal select, I'm assuming "order" isn't important (perhaps you are building a temporary summary file from a detail ?). Anyway, you could always harness the "Drumheller Trick" and have an I-type that actually does the "work" - fire off a select (or SSelect, LIST etc) & then simply reference the dictionary item --> one pass through the file PLUS the 'expressiveness' of TCL/ACCESS Same sort of thing can be done with any mv flavout these days that supports some mechanism for calling Basic code from a dictionary. AFAIK, the internal select does NOT traverse twice ... simply has a pointer into a group (starts at base of file), and move through records in current frame, when exhausted goes to next frame etc --> 1 pass, quite quick. Need to be "careful" though - there was a thread on jbase group in last 6 months that indicated some "tuneables" that could actually cause the sorts of problems with group shuffling that you are talking about Ed Sheehan wrote: I posted this on U@UG, but so far, nothing: I believe I'm up to speed on most other platforms' use of BASIC internal selects, but I haven't seen anything conclusive for Universe. We are using a lot of external selects to avoid the "problem" (I think it's a myth) of updating/deleting with an internal select, having the group shuffle underneath those selects, then experiencing either data corruption or unexpected results. AFAIK, these days, the only caveat for avoiding internal selects is if you change the ID, and it gets written into a subsequent group and then re-selected (unwantedly). Are there any Universe internals gurus out there who can shed some compelling light on this subject? I want to take this to the bosses and stop traversing the files twice if we don't have to. (Actually, I think both methods traverse twice - but the internal method is much more likely to select and read a frame without having it flushed between the select and the read.) Thanks for your time. Ed |
#5
| |||
| |||
|
|
Ed, I think it is a myth too. Back in R83 & AP days, I had a some basic utilities that were replacements for istat, but displayed results as each group was traversed, rather than waiting until the end of file is reached to display the results of the first and subsequent groups (which can be a really long time on a big file). These programs worked by interrogating the select list variable, e.g. open "file" to fv select fv to list loop ?? = list<1 ?? = list<2 etc readnext id from list else exit repeat The stuff in list is partly in hex (the file base, the current group, etc) and partly a list of ids in the next group; as each group is used up the next group is read in. Unfortunately, the internal dynamics of this select list variable kept changing in D3 versions, thus my utilities stopped working and I lost interest in the reverse engineering process. But the point is, for R83, AP, D3 and the like, a basic internal select grabs the item-ids one group at a time; writing back to the current group may shuffle the order of items in the group, but does not affect the ids from the group in the select list variable, which were all read in once when the new group was first encountered. I have to believe that the U2 products work the same way. Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 Ross Ferris wrote: Well, depending on WHAT you are doing with the select list, you could always have the best of both worlds !?!? If you are considering an internal select, I'm assuming "order" isn't important (perhaps you are building a temporary summary file from a detail ?). Anyway, you could always harness the "Drumheller Trick" and have an I-type that actually does the "work" - fire off a select (or SSelect, LIST etc) & then simply reference the dictionary item --> one pass through the file PLUS the 'expressiveness' of TCL/ACCESS Same sort of thing can be done with any mv flavout these days that supports some mechanism for calling Basic code from a dictionary. AFAIK, the internal select does NOT traverse twice ... simply has a pointer into a group (starts at base of file), and move through records in current frame, when exhausted goes to next frame etc --> 1 pass, quite quick. Need to be "careful" though - there was a thread on jbase group in last 6 months that indicated some "tuneables" that could actually cause the sorts of problems with group shuffling that you are talking about Ed Sheehan wrote: I posted this on U@UG, but so far, nothing: I believe I'm up to speed on most other platforms' use of BASIC internal selects, but I haven't seen anything conclusive for Universe. We are using a lot of external selects to avoid the "problem" (I think it's a myth) of updating/deleting with an internal select, having the group shuffle underneath those selects, then experiencing either data corruption or unexpected results. AFAIK, these days, the only caveat for avoiding internal selects is if you change the ID, and it gets written into a subsequent group and then re-selected (unwantedly). Are there any Universe internals gurus out there who can shed some compelling light on this subject? I want to take this to the bosses and stop traversing the files twice if we don't have to. (Actually, I think both methods traverse twice - but the internal method is much more likely to select and read a frame without having it flushed between the select and the read.) Thanks for your time. Ed |
#6
| |||
| |||
|
|
Afaik, all current Pick products work one group at a time, caching the ids, so you can neither have data nor file corruption using an Internal Select. What can happen, though, is that a new item written by someone else will not be selected, |
|
using Readu, aren't you?) |
|
you are not locking the file from read/writes. snip |
#7
| |||
| |||
|
|
Inline... "murthi" <c_xyz_murthi (AT) seeing_xyz_green (DOT) net> wrote in message news:QTpje.4754$BF5.1720 (AT) trndny06 (DOT) .. Afaik, all current Pick products work one group at a time, caching the ids, so you can neither have data nor file corruption using an Internal Select. What can happen, though, is that a new item written by someone else will not be selected, This would be the case even with an external select, no? or one deleted will not be present when you Readu (you are using Readu, aren't you?) also the same for externals... |
|
Which is pretty much what you should expect, since you are not locking the file from read/writes. snip We do a lot of processing, purging etc. Most of these processes do external selects, even when there is no selection criteria. Several of these files may have 1 million to 9 million records (pretty soon you're talking real numbers). I think the potential time savings would be impressive. |
|
Thanks for your thoughts. Y'r Welcome... Chandru Murthi Ed |
#8
| |||
| |||
|
|
Inline... "murthi" <c_xyz_murthi (AT) seeing_xyz_green (DOT) net> wrote in message news:QTpje.4754$BF5.1720 (AT) trndny06 (DOT) .. Afaik, all current Pick products work one group at a time, caching the ids, so you can neither have data nor file corruption using an Internal Select. What can happen, though, is that a new item written by someone else will not be selected, This would be the case even with an external select, no? |
|
We do a lot of processing, purging etc. Most of these processes do external selects, even when there is no selection criteria. Several of these files may have 1 million to 9 million records (pretty soon you're talking real numbers). I think the potential time savings would be impressive. |
#9
| |||
| |||
|
|
"Ed Sheehan" <NOedsSPAM (AT) xmission (DOT) com> wrote in message news:d6lfbr$sc1$1 (AT) news (DOT) xmission.com... Inline... "murthi" <c_xyz_murthi (AT) seeing_xyz_green (DOT) net> wrote in message news:QTpje.4754$BF5.1720 (AT) trndny06 (DOT) .. Afaik, all current Pick products work one group at a time, caching the ids, so you can neither have data nor file corruption using an Internal Select. What can happen, though, is that a new item written by someone else will not be selected, This would be the case even with an external select, no? As I recall the internal and external selects work slightly differently at least in Pick/D3. An I'm willing to be corrected if I'm wrong. As I remember, the external select gets all the ID's within the file, while the internal select gets the id's of each group as it moves from group to group. So in theory a person could be working with an internal select at the beginning of a file while another user add/deletes items at the end of the file. The internal select will get the latest ID's when the process moves into the said group. We do a lot of processing, purging etc. Most of these processes do external selects, even when there is no selection criteria. Several of these files may have 1 million to 9 million records (pretty soon you're talking real numbers). I think the potential time savings would be impressive. I'm told that if you are traversing all/most items in a file, the internal select list is suppose to be faster. If you want to skip processing only a few percentage of records, I believe it is faster to make the decision inside the program using the internal select. If I'm wrong on any of this, someone please sound off, 'cause I'm wasting a lot of processor cycles if I am. Best regards, Dale |
#10
| |||
| |||
|
|
I think you're right on all counts. The only drawback (other than selection criteria) I can think of with internal selects is if you change the key and write to a subsequent group, then it reselects it (unwantedly) later. |
|
As to efficiency, I just did an exhaustive benchmark on a huge file, comparing an internal select against an external. There were some selection criteria argued (IF SOMETHING = "1""2""3"... etc), and the external actualy beat the internal. The internal was building a select dynamic array as it compared SOMETHING to a validation list. The external was actually relatively more efficient as elements were added to the criteria, by several magnitudes. But when all criteria were eliminated, the internal was about twice as fast. |
|
Moral: If no selection criteria then use internal If selection criteria then probably use external (but verify on large files) Ed |
![]() |
| Thread Tools | |
| Display Modes | |
| |