If they only run this code once a month, why don't you put the code in a bat 
file and run it on the server off hours and send the results to someone?


-----Original Message-----
From: karentellef via RBASE-L <[email protected]>
To: [email protected]
Date: Fri, 28 Apr 2017 17:21:29 -0400
Subject: Re: [RBASE-L] - Compute vs Select

I have no temp tables created yet.Probably won't be getting to this project 
until next week, just gathering ideas at this time.  They'll next run the 
program on May 20 (they run it once a month) so I'd like to have something 
in place by then


Karen



-----Original Message-----
From: Dan Goldberg <[email protected]>
To: rbase-l <[email protected]>
Sent: Fri, Apr 28, 2017 3:47 pm
Subject: Re: [RBASE-L] - Compute vs Select


Have u tried indexing the temp tables?

Dan Goldberg
Lance Camper





On Fri, Apr 28, 2017 at 1:07 PM -0700, "karentellef via RBASE-L" 
<[email protected] [mailto:[email protected]]> wrote:


Just an FYI

Idid a comparison of "compute" vs "select" in Version X (works the same as 
9.5).

See the print-screen below.  I tested with a where clause that will fail, I 
tested both a SUM and a COUNT:

With zero ON (my default)
   SUM  
      "compute" returns a null
      "select"  returns a 0
   COUNT
      both return a 0
   No errors are returned

With zero OFF
   SUM
      both return a null
   COUNT
      both return a 0
   A "warning" is returned only for the Select Sum


So in my old code, I can replace my "compute" with "select" when I'm doing a 
"COUNT" because it always returns a 0

However, I cannot easily replace my "compute SUM" with a "select" because 
the program tests for a result being null, and it instead would evaluate as 
0.  I would have to either (a) change my checking to look at 0 rather than 
null or (b) change my zero to OFF, which I'm reluctant to do for the entire 
routine because that would change everything, so I'd have to set it off and 
back on around every single compute statement, and there's alot of them.

Speed:  Couldn't get a good comparison.  Everything I tried took either 1 or 
2 seconds and they switched back and forth, so I'm guessing it was 
"rounding".  Seems like they're about equal in speed.

BTW: these are two of the lookup-type of variable gathering commands that 
are in my monster cursor program.  The first table AgtComm has 4 million 
rows, with RecDate indexed.  However, it usually (not always) looks at just 
one month's worth of data, which is usually around 55,000 rows.  So I can 
pull that 55,000 rows into a temp table to see if it speeds up.

Karen


--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to [email protected] 
[mailto:[email protected]].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to [email protected] 
[mailto:[email protected]].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
 --
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to [email protected] 
[mailto:[email protected]].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].

-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to