Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Subquery Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053707
Message ID:
00053717
Views:
31
>I thought I had this all figured out when using NOT EXIST on a SQL SELECT. But I think not... I left the following code running on my workstation when I left last night. I came in this morning to find "Not Enough Disk Space for Temp File" error message from first query. My tables are huge so this error is common for me. So I re-ran the same code on my database server (a killer NT4 machine where tables are stored) And for 3 minutes the query progressed slowly, it reached 32% and then just sat there. It is still just sitting there after 30 minutes. What did I do wrong this time?
>
>SELE addunit.account, azactive.name FROM addunit, azactive ;
> WHERE NOT EXISTS( ;
> SELE * FROM addunit WHERE addunit.account==azactive.acct) ;
> INTO CURSOR temp1
>
>SELE azhandle.account, azactive.name FROM azhandle, azactive ;
> WHERE NOT EXISTS( ;
> SELE * FROM azhandle WHERE azhandle.account==azactive.acct) ;
> INTO CURSOR temp2
>
>
>SELE * FROM TEMP1 ;
>UNION ;
>SELE * FROM TEMP2 ;
>INTO TABLE AZTERMS
>
>Notes: Using 2.6 tables in VFP 5.0a, addunit has approx. 46,000 records, azactive has approx. 193,000 records, azhandle has approx 454,000 records, index tags in place for addunit.account and azhandle.account

I see grave problems in your queries. Let's look at first Select. I understand that you want to retrieve all addunit.account which are not in azactive table. So far, so good, but after VFP retrieved them, how it's going to link azactive.name to new records. The only answer from your code is to make cross join, i.e. ~46K addunit records multiply 193K azactive. It's not surprizing that you are out of space.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform