Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed problem
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00445751
Message ID:
00445786
Views:
15
>To get cross join, also called cartesian product, you do select from two tables w/o specifying join condition.
>
>SELECT t1.State, t1.Town, t2.Period, t2.UserGrp FROM t1, t2 INTO TABLE t3
>
>This way each record from table t1 will be joined with each record from table t2.
>


Thanks a lot. With this idea and without this idea on my local machine it took 24 sec. for RI. On the network it took 1m.55sec. So, it's definitely a network problem.

>>Hi Sergey,
>>
>>Thanks for your response. Actually, I showed the whole number of iterations (e.g. 51*12*number of towns, for RI=42, for MA ~150). So, the total number of iterations for RI is 28512, still it took 1min.57 sec., which is really slow, I think.
>>
>>How can I create a cross join, it's not clear for me, (I thought about it too). Could you please help me here? Meanwhile I'll try the same test on my local drive.
>>
>>>Hi Nadya,
>>>
>>>1) The tables you are creatin are quite large: For RI for one year more than 1 million records.
>>>2) Try to put result table on local drive and see what difference it makes.
>>>3) Instead of calculating period and UserGrp for each record create cursor with 51 possible combination and than cross join it with resault of your select
>>>
>>>HTH
>>>

>>>>Hi everybody,
>>>>
>>>>I have a quite simple program for pre-populating a table. For RI it has 28152 iterations, for MA ~236000. For some reason, it works really slow (1min.56 sec. for RI, 27 min. for MA). I suspect server's problem, but our Network Administrator tells me, that server is ok. I tried switching order between scan...endscan and for...next. Once this program executes really fast, but then again worked very slow. Could you please tell, is something wrong with the code?
>>>>How can I speed up this program?
>>>>
>>>> < snip >
>>>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform