Re: Help with SQL optimization

2016-05-15 Thread Joe Yoder
Thanks Ted, I never really understood the usefulness of a primary key before. Now I do. I check with and without the the indexes and saw little difference - about 1/5 of a second instead of 15! Thanks again, Joe On Sun, May 15, 2016 at 4:50 PM, Ted Roche wrote: > Yeah, that's just wrong. T

Re: Help with SQL optimization

2016-05-15 Thread Ted Roche
Yeah, that's just wrong. The query should take 1 second or less. Index matches only work if the expression of the index is IDENTICAL to the expression used in the left side of a WHERE clause. ALLTRIM does not work in indexes, as VFP indexes have to have the same length. It's a BEST Practice to n

Help with SQL optimization

2016-05-15 Thread Joe Yoder
I have a process that starts out with a table of about 4300 records. An SQL select yields a cursor of only the records not already in a master table for processing and gradual addition to the master table. When the master table was empty my SQL results were sub second. Now that the master table