# modifying/deleting a record while prefetching it

**URL:** <https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes, Adabas-Basics-on-Mainframes\
**Created:** [May 27, 2008, 10:25pm UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822 "2008-05-27T22:25:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cobp3](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@cobp3](https://techcommunity.softwareag.com/u/cobp3)\
**Post date:** [May 27, 2008, 10:25pm UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822/1 "2008-05-27T22:25:58Z")

</div>

> [@](#):
>
> The Effects of ISN Changes on Prefetched or Multifetched Records
> 
> If a prefetched or multifetched record is updated, the following processing is applied:
> 
> Important:  
> You should not modify a file (especially the descriptor being accessed) while reading or locating (finding) records in the same file.

Would it be a problem while modifying/deleting a record while prefetching it? Would this causes problem only for the ISN modifications?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [May 28, 2008, 12:26am UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822/2 "2008-05-28T00:26:54Z")

</div>

The problem is performance. Except in rare cases, any performance gain from Prefetch will be eliminated by Hold Queue processing. (The impact is so negative that, for statement-level multi-fetch, the Natural compiler will ignore the MULTI-FETCH clause in an update loop.)

---

<div class="post-metadata">

**Author:** ![cobp3](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@cobp3](https://techcommunity.softwareag.com/u/cobp3)\
**Post date:** [May 28, 2008, 2:06pm UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822/3 "2008-05-28T14:06:24Z")

</div>

> [@](#):
>
> Except in rare cases, any performance gain from Prefetch will be eliminated by Hold Queue processing

I think Peformance gain from Prefetch is mainly by reducing the nr. of ADABAS CALLs by bufferings. So lesser the nr. of ADBAS calls(using large nr. of PREFETCH buffers), more performance gain. Isn’t it?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [May 28, 2008, 9:30pm UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822/4 "2008-05-28T21:30:21Z")

</div>

Applying Prefetch to a READ/FIND/HISTOGRAM loop can improve performance dramatically - elapsed times can drop by 50% to 80%. This is a result of reduced inter-region communication (loosely speaking, fewer Adobes calls).

But if you apply Prefetch to an update loop, you will see performance suffer. All the records are placed in the hold queue, and your ET logic will cause uncommitted records to be released from the hold queue and re-held. This overhead will more than compensate for any Prefetch gains.

Only in very rare cases will Prefetch improve performance of an update loop!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:49pm UTC](https://techcommunity.softwareag.com/t/modifying-deleting-a-record-while-prefetching-it/76822/5 "2021-04-02T14:49:30Z")

</div>


