# Which is more efficient READ/FIND?

**URL:** <https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [May 10, 2006, 12:44pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943 "2006-05-10T12:44:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [May 10, 2006, 12:44pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/1 "2006-05-10T12:44:15Z")

</div>

Hi all,

Can anyone tell me out of READ and FIND which is more efficient and why?

Thanks

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 10, 2006, 5:48pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/2 "2006-05-10T17:48:22Z")

</div>

It depends! A rule of thumb is:

READ is for mass data operations  
FIND is good for finding and sorting less records

See also:  
[http://adabas.forums.softwareag.com/viewtopic.php?t=862](http://adabas.forums.softwareag.com/viewtopic.php?t=862)

---

<div class="post-metadata">

**Author:** ![Curtis\_Pew](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Curtis\_Pew](https://techcommunity.softwareag.com/u/Curtis_Pew)\
**Post date:** [May 12, 2006, 12:18am UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/3 "2006-05-12T00:18:09Z")

</div>

The way I would put it: if you want to zero in on a specific group of records, use FIND. If you want to browse through a range of records, use READ.

Examples:  
Find out how much a particular employee makes – use FIND  
Output an employee phone book – use READ EMPLOYEES BY LAST-NAME  
Verify that every employee has a valid ZIP code – use READ PHYSICAL (assuming ZIP is not a descriptor.)

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [May 12, 2006, 11:58am UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/4 "2006-05-12T11:58:46Z")

</div>

What do you mean by"efficient" ?

- efficient in lines of code and understanding
- efficient in number of database calls
- efficient in number of database io’s
- efficient in response time / database duration
- efficient in cpu usage of the database service
- efficient in cpu usage of the natural program
- efficient in accounting costs (which may be a mixture of the above)

and so on.

If you ask such a question, please provide an example.

---

<div class="post-metadata">

**Author:** ![FerozImtiaz](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@FerozImtiaz](https://techcommunity.softwareag.com/u/FerozImtiaz)\
**Post date:** [May 12, 2006, 11:13pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/5 "2006-05-12T23:13:53Z")

</div>

Depends,

for example - if you have 1000 records

1. and you intend processing most (more than say 80 % depends on the environment) use read. NOTE: The higher the number of records the higher the percentage should be.

2. if you intend processing only a few records then use FIND

Another pre-emptive measure for assigning descriptors is,

If you are not sure you will use it as a descriptor define the field as a NON DESCRIPTOR with N and write your code as FIND (ADABAS will convert it into a READ) and later on if you decide that it should be a descriptor change only the ADABAS file - the programs will not need any change.

Good luck

Feroz Imtiaz

---

<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:** [May 12, 2006, 11:46pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/6 "2006-05-12T23:46:09Z")

</div>

> [@Feroz Imtiaz](#):
>
> 1. and you intend processing most (more than say 80 % depends on the environment) use read. NOTE: The higher the number of records the higher the percentage should be.

I disagree here, a growing number of records should see the percentage shrink, not rise.

---

<div class="post-metadata">

**Author:** ![FerozImtiaz](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@FerozImtiaz](https://techcommunity.softwareag.com/u/FerozImtiaz)\
**Post date:** [May 13, 2006, 11:27pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/7 "2006-05-13T23:27:36Z")

</div>

> [@Wolfgang Winter](#):
>
> > [@Feroz Imtiaz](#):
> >
> > 1. and you intend processing most (more than say 80 % depends on the environment) use read. NOTE: The higher the number of records the higher the percentage should be.
> 
> I disagree here, a growing number of records should see the percentage shrink, not rise.

Think about it,

TOTAL RECORDS RECORDS to PROCESS % USE

* * *

1000 800 80 READ  
100,000 90,000 90 READ  
100,000 50,000 50 READ / FIND

You are right, if it is READ LOGICAL and escape. For READ PHYSICAL maybe a FIND is better

---

<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:40pm UTC](https://techcommunity.softwareag.com/t/which-is-more-efficient-read-find/60943/8 "2021-04-02T14:40:38Z")

</div>


