Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Full Optimize this
Message
From
08/03/2013 08:15:20
 
 
To
07/03/2013 22:06:12
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01567687
Message ID:
01567846
Views:
44
Likes (1)
>I have removed DELETED() tag from all tables and tested like below :
>
>
>Local lcLiftcond
>Clear
>Clear All
>On Error llerror = .T.
>
>**  Set deleted OFF to test the optimization
>Set Deleted Off
>
>Close Databases All
>Use 1001\psaudac In 0 Exclusive
>Use 1001\psaudam In 0 Exclusive
>Use 1001\customer In 0 Exclusive
>Use 1001\pcode1 In 0 Exclusive
>
>Select psaudac
>Select psaudam
>Select customer
>Select pcode1
>
>lcLiftcond = '.T.'
>
>	Do Case
>	Case Thisform.Optiongroup1.Value = 1
>		Thisform._lcliftdate = ".T."
>	Case Thisform.Optiongroup1.Value = 2
>		Thisform._lcliftdate = "empty(liftdate)"
>	Case Thisform.Optiongroup1.Value = 3
>		Thisform._lcliftdate = "not empty(liftdate)"
>	Endcase
>
>lcLiftcond = Thisform._lcliftdate
>
>= Sys(3054, 1)
>
>	Select 0
>	Select ;
>			Str(Val(psaudam.saudano), 10) As dono, ;
>			godown.acname As locname, ;
>			party.acname As acname, ;
>			pcode1.wood As prodname, ;
>			mill.acname As millname, ;
>			psaudac.Lotno, ;
>			psaudac.Bags, ;
>			psaudac.Weight, ;
>			psaudac.liftdate, ;
>			psaudac.Rem1, ;
>			psaudac.Childid ;
>		From psaudam ;
>		Left Outer Join customer godown ;
>			On godown.accode = psaudam.loccode ;
>		Left Outer Join customer party ;
>			On party.accode = psaudam.accode ;
>		inner Join psaudac ;
>			On psaudac.Masterid = psaudam.Masterid ;
>		Left Outer Join pcode1  pcode1 ;
>			On pcode1.pcode = psaudac.pcode ;
>		Left Outer Join customer mill ;
>			On mill.accode = psaudac.millcode ;
>		Where psaudam.trnstatus = 'YO' ;
>			And &lcLiftcond ;
>		Order By 1 ;
>		Into Cursor junk1 Readwrite
>
>?Seconds() - m.lnSec
>
>= Sys(3054, 0)
>
>
>
>Result : table ' psaudam ' is showing full optimization and rest are : None, Why ?
>
>Using index tag Trnstatus to rushmore optimize table psaudam
>Rushmore optimization level for table psaudam: full
>Rushmore optimization level for table godown: none
>Rushmore optimization level for table party: none
>Rushmore optimization level for table psaudac: none
>Rushmore optimization level for table pcode1: none
>Rushmore optimization level for table mill: none
>

You get "None" for any table that's not used in the WHERE clause because there' s nothing to optimize. However, you haven't checked optimization of your join conditions. Try using SYS(3054,11)--you'll see the order in which the joins are processed and the tags used to optimize the joins.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform