AREV - REDUCE

AREV - REDUCE

Post by N J Won » Sat, 13 Jan 1996 04:00:00



I was looking for a way to speed up PERFORM "SELECT..." statements from
an RBASIC program due to customer complaints about speed when I came
across the REDUCE system subroutine. I was delighted to find that there
was a considerable improvement in system response by replacing the
PERFORM "SELECT ..." with an equivalent call to REDUCE (a 15 seconds
search reduced to 7 seconds is most welcomed). However, I soon received
a call from my customer that if no records could be selected by the
REDUCE call, I was returning the whole list to him.

In my old version, I used codes such as :
PERFORM "SELECT ..."


returned by REDUCE is also set as successful, so I can't use this as a
test for no records selected.

Is there anyone out there with a solution to this? I would dearly love
to use REDUCE to get the speed improvement, but I can't if there is no
way to test for zero records selected.

Thanks in advance,
NJ

 
 
 

AREV - REDUCE

Post by Stephen Rathkop » Sun, 21 Jan 1996 04:00:00



writes:

>I was looking for a way to speed up PERFORM "SELECT..." statements
from
>an RBASIC program due to customer complaints about speed when I came
>across the REDUCE system subroutine. I was delighted to find that
there
>was a considerable improvement in system response by replacing the
>PERFORM "SELECT ..." with an equivalent call to REDUCE (a 15 seconds
>search reduced to 7 seconds is most welcomed). However, I soon
received
>a call from my customer that if no records could be selected by the
>REDUCE call, I was returning the whole list to him.

>In my old version, I used codes such as :
>PERFORM "SELECT ..."

>With PERFORM "SELECT ..." replaced by a REDUCE call, I found that

parameter
>returned by REDUCE is also set as successful, so I can't use this as a
>test for no records selected.

>Is there anyone out there with a solution to this? I would dearly love
>to use REDUCE to get the speed improvement, but I can't if there is no
>way to test for zero records selected.

>Thanks in advance,
>NJ

*****************************************************************

You might try using the READLIST/WRITELIST and/or FORMLIST verbs
depending on the verb list of the system you are working on

Steve Rathkopf

 
 
 

AREV - REDUCE

Post by Sprezzatura L » Tue, 23 Jan 1996 04:00:00



>>to use REDUCE to get the speed improvement, but I can't if there is no
>>way to test for zero records selected.

>>Thanks in advance,
>>NJ

ok, you need to understand how reduce words...

When you readnext normally in AREV it grabs a frame and then returns
the keys from that frame (RTP11 I think). When you call reduce it
writes a small program which sits between the ReadNext and the RTP
called RTP20.x which filters out the ids which don't match the
criteria.

This means that until the readnext list is exhausted OR the first
matching key is found, there is no way of finding out if reduce is
going to return any keys. In other words there is a latent select list
active.

The action to take will depend on the next thing you're doing in your
program - I imagine you're performing something else - if so you have
two choices, pre-process the select list or do the Performed stuff
yourself IE

        Call reduce....
        EoF = 0 ; NewList = ""
        Loop
                ReadNext Id Else EoF = 1        
        Until EoF Do

        Repeat
        NewList[1,1] = ""
        If Len(NewList) Then
                Call Make.List(0, NewList, "", "")
                Perform Whatever
        End

OR

        Call reduce....
        EoF = 0 ; NewList = ""
        Loop
                ReadNext Id Else EoF = 1        
        Until EoF Do
                Read Row From vFile, Id Then
                        Write Row On NewFile, Id Else Call FsMsg()
                End
        Repeat

Regards

Andrew
http://ourworld.compuserve.com/homepages/AMcA_At_Sprezzatura
        If Len(NewList) Then
                Call Make.List(0, NewList, "", "")
                Perform W

 
 
 

AREV - REDUCE

Post by Bob Woodwar » Tue, 23 Jan 1996 04:00:00



Rathkopf ) writes:


>writes:

>>I was looking for a way to speed up PERFORM "SELECT..." statements
>from
>>an RBASIC program due to customer complaints about speed when I came
>>across the REDUCE system subroutine. I was delighted to find that
>there
>>was a considerable improvement in system response by replacing the
>>PERFORM "SELECT ..." with an equivalent call to REDUCE (a 15 seconds
>>search reduced to 7 seconds is most welcomed). However, I soon
>received
>>a call from my customer that if no records could be selected by the
>>REDUCE call, I was returning the whole list to him.

>>In my old version, I used codes such as :
>>PERFORM "SELECT ..."

>>With PERFORM "SELECT ..." replaced by a REDUCE call, I found that

>parameter
>>returned by REDUCE is also set as successful, so I can't use this as
a

>>test for no records selected.

>>Is there anyone out there with a solution to this? I would dearly
love

>>to use REDUCE to get the speed improvement, but I can't if there is
no
>>way to test for zero records selected.

>>Thanks in advance,
>>NJ

>*****************************************************************

>You might try using the READLIST/WRITELIST and/or FORMLIST verbs
>depending on the verb list of the system you are working on

>Steve Rathkopf

Interesting, Steve.  I didn't know there were such verbs in AREV.  :)


current status of any active filter you have.  You should be able to
tell by the value of this flag as to the type of active filter you have
(or don't have).  

 
 
 

AREV - REDUCE

Post by Scott Steph » Fri, 26 Jan 1996 04:00:00


Perhaps a REDUCE and the rbasic SELECT BY convination might work.
I didn't know that one could use REDUCE with only READNEXT without any
selection. The manual indicates that REDUCE is to be used with SELECT BY.
From the explanation given by Andrew as to the working of REDUCE,
I think you will get the same performance execution if you use
the REDUCE/SELECT BY convination. And also, it will closely match
the program structure of the original one.
Scott
 
 
 

AREV - REDUCE

Post by Sprezzatura L » Thu, 22 Feb 1996 04:00:00


.

Quote:>From the explanation given by Andrew as to the working of REDUCE,

weird - my news server never showed that my message showed up. Mind
you I'd noticed that Compuserve's news server seems to pick up a lot
more than the ISP I use for mainteance of our URL from home,,,, oh
well...
 
 
 

AREV - REDUCE

Post by Andrew P McAule » Fri, 23 Feb 1996 04:00:00


Even weirder - this last message was posted weeks ago...

--
AMcA
Sprezzatura - European leaders in all things Rev Soft
http://ourworld.compuserve.com/homepages/AMcA_At_Sprezzatura

 
 
 

1. Arev 3.1 Does anyone know if compound selects are available in Arev 3.1

I have run into a problem with Advanced Revelation 3.1. Example:

: SELECT DBFILE WITH SOME_DATE AFTER "1/1/95" AND WITH STATUS "A"

The problem is that the AND portion of the select statement is completely
ignored. I have resorted to successive select statements for AND
conditions, but
still have no solution for OR conditions. Please Help!!!

2. Oracle-SQL-Server / Novell 3.11/ Data-Export

3. interfaces/ecpg/preproc reduce/reduce conflicts

4. copying ADO recordset

5. ecpg/preproc.y is generating reduce/reduce conflicts

6. Appending to text file?

7. SQL Server -> AREV

8. Complex query

9. SQL /AREV /OI opportunity in MD

10. VB and AREV

11. AREV / OPEN INSIGHT

12. Oracle -> AREV

13. editing syscolumns in arev