Store the AddBS() function and the cClaimsTable reference to variables, then use those variables in the SELECT statement.
You're evaluating each expression with every row. Bill Anderson On Thursday, August 16, 2012, MB Software Solutions General Account wrote: > VFP9SP2 - WinXP - dbfs on network > > I have to query 2 tables to populate a lookup list: > > SELECT x1.provnum ; > FROM (ADDBS(this.cDataPath)+this.cClaimsTable) x1 ; > UNION ; > SELECT x2.provnum ; > FROM (ADDBS(this.cDataPath)+this.cDischargeTable) x2 ; > INTO CURSOR curTemp > > This query is taking forever (4 minutes!). There's no WHERE clause so > it's not optimizable. But is there a better way? > > My current plan now is to create logic that extracts the provnums into a > separate table and just query that. That makes complete sense to me. > (These tables are basically input files from a vendor, with the provnum > built in and not sent in a separate lookup table.) > > Other ideas? > > tia, > --Mike > > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/ca+o1engwqnoi80ohupv1n27zwvqww4uelco6i74hqtkb_fw...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

