![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"Ed Sheehan" wrote: Do all platforms support READV of attr 0? I'm thinking D3 doesn't, or at least didn't. And as far as limiting memory usage by reading attr 0, I believe the entire record is always read into memory, and just the requested attribute is copied into process workspace. Maybe it's just a slight improvement after all. D3 does not support READV/0. I hope I have this right - I'll defer to someone with a clue... We need to separate the concept of memory and workspace here. If you have large items then READV/WRITEV prevent reading the entire buffer into BASIC workspace. When this happens with a whole item, BASIC is going to suck in as many frames as it needs to hold the variable. If you're working with FlashBASIC then this is all done in memory. But at the DBMS level, all of the data needs to be pulled from disk into memory anyway (not BASIC workspace) so that it can be scanned for attribute marks. So while you save something in post-read frame manipulation, you gain nothing in disk IO access time. With WRITEV, a smarter MV system will not read the item into workspace before the update, it will count the number of bytes in the current attribute on disk and replace the attribute in-line if it matches the number of new bytes. If the byte count is different then the DBMS needs to shift frames up or down, pretty much negating the imagined economy of a WRITEV. Every platform does this differently. HTH T |
#12
| |||
| |||
|
|
Maybe I'm missing something. If you don't have the Item Id how would you perform Readv without giving an Item Id?. If you want just the Item Id then Readnext ID Else seems the easy way. Seems like a Catch 22. |
#13
| |||
| |||
|
|
"RJ" wrote: Maybe I'm missing something. If you don't have the Item Id how would you perform Readv without giving an Item Id?. If you want just the Item Id then Readnext ID Else seems the easy way. Seems like a Catch 22. Bob, the concept of ReadV/0 doesn't mean you're trying to get information about the item ID. It means you're testing to see if the item exists. See: http://www.pickwiki.com/cgi-bin/wiki...ips_And_Tricks It's a convention, a trick that people have coded into, but (not that I've tried it anytime recently) I don't believe D3 supports this trick. I know this particular trick has caused some sites difficulty in migration - as use of many non-standard tricks will... HTH T |
#14
| |||
| |||
|
|
word of warning Revelation readv from xx,ID,0 returns the complete record note: I havent tested other versions of MV yet. Rich |
#15
| |||
| |||
|
|
Here's my test program, GBP TEST: OPEN 'GBP' TO FV ELSE STOP 201,'GBP' READV GOO FROM FV,'TEST',0 ELSE GOO = 'NO CAN READV' CRT CHANGE(GOO,@AM,CHAR(13):CHAR(10)) Anybody wanna guess what the output of this program might be? spoiler... answer below... It produces "1" (without the quotes.) Maybe it's returning a Boolean?!? Maybe it's returning the status bit (success/no success) from the |
#16
| |||
| |||
|
#17
| |||
| |||
|
#18
| |||
| |||
|
|
Why not write a little test process and test yourself??? Wouldn't take much, and if you were REALLY so inclined, could also then look at the impact or poorly sized files, as well as different file types (dynamic springs to mind) You will then have MEANINGFUL data for YOUR environment .... all for little more than it took to write your email, and much less time than it will take me to read the thread :-) |
#19
| |||
| |||
|
|
Since translate through attribute 0 returns the entire record, I suspected that READV would, too. OPEN 'GBP' TO FV ELSE STOP 201,'GBP' READV GOO FROM FV,'TEST',0 ELSE GOO = 'NO CAN READV' CRT CHANGE(GOO,@AM,CHAR(13):CHAR(10)) Anybody wanna guess what the output of this program might be? |
#20
| |||
| |||
|
|
The simple rule to follow is always dimension all items as an array and always equate every element of the array to a standard variable then |
![]() |
| Thread Tools | |
| Display Modes | |
| |