× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>From: rob@dekko.com
>Date: Thu, 1 Nov 2001 15:22:17 -0500
>
>Test 1:  I,F,blocked, no key.  Takes 1 minute 31 seconds
>     FITHL01    IF   E             DISK    BLOCK(*YES)
>
>     C                   DOW       NOT %EOF(ITHL01)
>     C                   READ(E)   ITHL01
>     C                   EndDo
>
>     C                   EXSR      LRSUB
>
>Test 2:  I,F,unblocked, no key.  Takes 1 minute 42 seconds
>     FITHL01    IF   E             DISK
>
>     C                   DOW       NOT %EOF(ITHL01)
>     C                   READ(E)   ITHL01
>     C                   EndDo
>
>     C                   EXSR      LRSUB

Rob, your Test 2 is blocked even though you didn't code BLOCK(*YES).
Check for that 7086 message - it's issued for non-primary files
too.  You'd have to code BLOCK(*NO) to get it unblocked.  The 9 seconds
difference is insignificant.

>Here are my questions:
>When should you use BLOCK(*YES)?
>Is there an overhead to blocking?  For example if I am only reading a
>couple of records, does it take overhead to load a huge chunk of data for
a
>couple of records?
>Should you use it when doing random chains all over the file?
>Should you use it when doing a SETLL/READ but only reading a few records?
>If not, then when is the cut over from when to use it and not to use it?

You could test whether or not there's overhead for blocking by writing
a program (BLOCK(*YES) and BLOCK(*NO) that does a SETLL+READ over and
over.  But I think there has to be some overhead for fetching the records
that aren't going to be used.  The overhead will probably depend on
the nature of the records.  If there's any special stuff to do (like
formatting a date field or fetching a varying length field) it might
be significant.

I doubt that you can come up with a formula to decide whether to use
blocking or not.  You'd have to measure the cost of fetching an
average record for a given file based on the time it takes to fetch
the whole block divided by the average number of records you think
you'll use for a block.  If that's smaller than the time it takes to
fetch a record unblocked, then use blocking.  And remember to retest
the performance differences once in a while, to make sure your choice
is still correct.

Barbara Morris



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.