As always, test any change.
And, if it ain't broke, don't fix it.

The key (pun intended) here is to understand how the parenthesis interact with 
efficiency.
Sometimes I use parenthesis to force use of the better index for a particular 
query, by effectively ruling out the less efficient index.

Case in point is a large table with index on custid and enterdate.

When I am querying for a range of entrydate's I parenthesize the custid part of 
the where clause WHERE (CustID) = .vCustID

This is because some customer have a huge number of entries, so the date range 
will least frequently bog the query down.

Dennis

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Frederick
Sent: Tuesday, May 18, 2010 9:20 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Expressions, Spaces, and Performance

Dennis,
Thanks for that one. I have always used parenthesis around variables to
make them easy to stand out. Time to change.

Tom Frederick
Elm City Center
1314 W Walnut
Jacksonville, IL 62650
O - 217-245-9504
F- 217-245-2350
Email - [email protected]

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dennis
McGrath
Sent: Tuesday, May 18, 2010 8:55 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Expressions, Spaces, and Performance

What will speed up your query is to remove the parenthesis around the
variable.
 Both of these syntaxes prevent using the index on ZID from being used.

WHERE ZID = (.vZID)
WHERE (ZID) = .vZID

This should be faster
WHERE ZID = .vZID

Dennis McGrath

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Emmitt
Dove
Sent: Sunday, May 16, 2010 3:50 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Expressions, Spaces, and Performance

Tom,

Short answer:  no, parsing the two formattings of your SELECT should
make no
practical difference to how fast R:BASE runs.

Emmitt Dove
Manager, Converting Applications Development
Evergreen Packaging, Inc.
[email protected]
(203) 214-5683 m
(203) 643-8022 o
(203) 643-8086 f
[email protected]


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom
Frederick
Sent: Sunday, May 16, 2010 14:39
To: RBASE-L Mailing List
Subject: [RBASE-L] - Expressions, Spaces, and Performance

This seems like a pretty elementary question but does the structure of 
how an expression is set up have any significant effect on performance? 
When writing expressions, I tend to write out all words and align/box 
items in a consistent format that makes it easy for others to read as in

the first example below. That includes me 6 months later. We are doing 
more wireless connections and some concern has popped up that the extra 
spaces/letters would effect performance speed as simply more info to 
process. As time has gone by my EEPs have gone from simple 20 liners to 
over some with well over 300 lines as we put more controls in. Have not 
seen any difference on the LAN, but the wireless field laptops are not 
the fastest machines. Using latest V8 and doing a complete jump to v9 in

the next week.

SELECT                                                  +
    Item1, Item2, ThirdThing, NumberFour  +
    INTO                                                    +
    aItem1             INDICATOR a1,           +
    aItem2             INDICATOR a2,           +
    aThirdThing     INDICATOR a3,           +
    aNumberFour  INDICATOR a4
    FROM Z_MHA_Summary WHERE ZID = (.vZID)

Compared to

SEL Item1, Item2, ThirdThing, NumberFour  INTO +
    aItem1 IND a1,  +
    aItem2 IND a2,  +
    aThirdThing IND a3, +
    aNumberFour  IND a4
    FROM Z_MHA_Summary WHERE ZID = (.vZID)

Tom Frederick
Jacksonville, IL


Reply via email to