Fred, When you have multiple WHERE conditions with AND/OR conditions or multiple AND conditions you should alway design the query such that RBASE processes the most restrictive condition(s) (return smallest number of records) first. The plan behind this is that as RBASE builds the internal query sequence each phrase will have fewer records to deal with. Depending on the number of records in your database and the complexity of the query you can see dramatic improvements in processing time/resource use.
On complex queries I am a big fan of using the MICRORIM_EXPLAIN variable and the EXPLAIN.DAT file. This show how the syntax analyzer decided to process you query. See www.rsyntax.com for further explanation of how to use the MICRORIM_EXPLAIN functionality. Razzak also has several FTE articles which might help you write queries that are better optimized. Jim Bentley --- Dennis McGrath <[EMAIL PROTECTED]> wrote: > I also take the trouble to parenthesize all mixed mathematical > expressions. > Some systems follow standard precedence rules and some do not. > I'd rather trust my code to explicitly state what I want to > happen, in what order, regardless of system bugs, > inconsistencies, and my memory!! > > Dennis McGrath > > > > ________________________________ > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf > Of Fred C Kopp > Sent: Wednesday, May 28, 2008 10:57 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: AND / OR processing > > Thanks Dennis. That's worth a lot more than 2 cents. I'll > take your advice and it should be smooth sailing with no > surprises. -- Fred > ----- Original Message ----- > From: Dennis McGrath<mailto:[EMAIL PROTECTED]> > To: RBASE-L Mailing List<mailto:[email protected]> > Sent: Wednesday, May 28, 2008 11:32 AM > Subject: [RBASE-L] - RE: AND / OR processing > > Fred, > > Using AND OFF sets you up to trip over CFG file > inconsistencies, not to mention that you code will not be > portable if you decide to use another front end. > > Stick with the standard SQL syntax and your code will always > run as you expect. > Whenever I have Ors, I make sure to properly parenthesize my > where clauses so there is never a question about my intent. > Get used to this and you can create clauses that do elaborate > mixes of ORs and ANDs to really streamline things when > necessary. > > My 2 cents > Dennis McGrath > > > > ________________________________ > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf > Of Fred C Kopp > Sent: Wednesday, May 28, 2008 10:22 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - AND / OR processing > > Good morning from PA, > > I built a simple application with Application Designer that > calls up various subsets of a union membership to eyeball > compare with paper dues reports. Some of the Where clauses > use OR. I like to SET AND OFF because I'm so used to that. I > place the OR statements first and they get processed first. > > It works fine when I RUN the application directly, but I want > to LAUNCH the app from a Main Menu just like RRBYW14 (thank > you, Razzak). When I do that, the OR statements are ignored > UNLESS I enclose them in parentheses, just as the Help advises > you to do when AND is set ON. It's almost as though AND is > being switched ON somewhere. Yeah, like I'd know that. > > You know what? I don't complain as long as I can swerve into > a solution. Just curious if anyone else has thoughts on this. > > I'm having fun! > Fred > > Fred C. Kopp > Authorized R:Base Developer > 19 Teri Lane > Washington, PA 15301 > > P 724-222-7376 > F 724-222-7376 > C 724-413-5534 > E [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> > Jim Bentley American Celiac Society [EMAIL PROTECTED] tel: 1-504-737-3293

