Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Won't Optimize when join in use...
Message
From
15/12/2000 09:51:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00453607
Message ID:
00453927
Views:
24
Well, try VFP7. As far as I know, something new added to sys(3054) function there, related to joins - too ;)

>>Hi!
>>
>>I shown you the process of how internally SQL Query in VFP works. Yes, locate will not be indexed, so query process will not be optimized too, because it works by similar way.
>>
>>Try to use query
>>
>>SELECT hpaph0.* FROM arappx ;
>>        INNER JOIN hpaph0 ON ;
>>	hpaph0.aphst_ = arappx.appst ;
>>	AND hpaph0.aphcty = arappx.appcty ;
>>	AND hpaph0.aphpol = arappx.apppol ;
>>	AND hpaph0.aphyr = arappx.appcyr ;
>>	INTO CURSOR cResult
>>
>>
>>As you see, I just swap tables in join. In such case VFP during making query will scan arappx table and lookup records from hpaph0 table. Second table is indexed, so lookups will be optimized - query optimized.
>>
>>
>>And look if it is optimized.
>
>I did a query like this and SYS(3045,11) shows no optimization, but I think that is because it isn't showing the join optimizations for some reason, only filter optimizations.
>
>I just blew away all indexes except the ones I needed on hpaph0, and my query speeded up. IT may be a case of bad indexes, though even on this faster query, SYS(3054,11) is still showong NONE for optimization. I tihnk I just don't understand SYS(3054), or at least cannot figure out why it won't show me the join optimization properly...
>
>Anyway, I think a complete delete of indexes and reindexing (using REINDEX on its own had no effect) might be all I need...
>
>Thanks for your time! If you think of anything else, let me know!
>
>JoeK
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform