Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slower Data Query
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00709908
Message ID:
00709960
Views:
24
Ali,

First, I moved your PRE tags and fixed the terminating one too.

What is the sequence that you run these queries, and do you do anything in between running them? What I am trying to get at is that VFP (and/or the OS?) could be cacheing the table the first time in, making any run after the first much faster anyway.
Now *if* that is the case, then I would guess that your QUERY#1 actually ran second.

Can you please tell us also:
a) field formats of: mhsb.id, mhsb.hplan, hplan.id, mhsb.kimlik, kimlik.id, hplan.exp
b) exact expression for each of the TAGs in the tables (that are involved in the query)
c) the version and SP level of VFP


Jim
>
>
>I have executed these two queries which is smilar to each other, time and again. I have obtain same unexpected result. My queries and questions is at below.
>
>Thank in Advance
>
>
>My Questions
>-------------
>1. 2.query is slower than 1.query. Why ?
>
>2. Rushmore optimization of second query is executed wrongly. Why ?
>Note that: A join between Kimlik and mhsb is created before mhsb and hplan table in second query. This prevent the rushmore engine to operate wrongly. To reach maxsimum query speed like in first query (0.01 seconds), the join between hplan and mhsb must be created before mhsb and kimlik.
>
>3. How can I solve rushmore optimization problem ?
>
>
>Note :
>-----------
> 1: recods of table : mhsb: 131.171; kimlik: 18.104 ; hplan:5
> 2: Each table has primary index on tag "id" and in addition to hplan has a index on tag "exp"
> 3: Due to small file size of resulted cussor of query is not affected on query execuation time.
> 4: set("dele") is on where query execute
> 5: there isnt any index related to deleted records
>
>---------------------
>1. QUERY
>---------------------
>select * ;
>  from AtpNet!mhsb, ;
>       AtpNet!hplan ,;
>       atpnet!kimlik ;
> where mhsb.hplan   = hplan.id ;
>   and mhsb.kimlik = kimlik.id ;
>   and hplan.exp like 'Abone%'
>
>Query Result :
>	Selected 5 records in 0.01 seconds
>
>
>result of SYS(3054 12, "cMemvar") is :
>	1.Rushmore optimization level for table mhsb: none
>	2.Using index tag Exp to rushmore optimize table hplan
>	3.Rushmore optimization level for table hplan: partial
>	4.Rushmore optimization level for table kimlik: none
>	5.Joining table hplan and table mhsb using index tag Hplan
>	6.Joining intermediate result and table kimlik using index tag Id
>
>---------------------
>2. QUERY
>---------------------
>select mhsb.id ;
>  from atpNet!mhsb, ;
>       atpNet!hplan ,;
>       atpnet!kimlik ;
> where mhsb.hplan  = hplan.id ;
>   and mhsb.kimlik = kimlik.id ;
>   and hplan.exp like 'Abone%'
>
>Query Result :
>	Selected 5 records in 3.17 seconds
>
>result of SYS(3054 12, "cMemvar") is :
>	1.Rushmore optimization level for table mhsb: none
>	2.Using index tag Exp to rushmore optimize table hplan
>	3.Rushmore optimization level for table hplan: partial
>	4.Rushmore optimization level for table kimlik: none
>	5.Joining table kimlik and table mhsb using index tag Kimlik
>	6.Joining table hplan and intermediate result using temp index
>
>
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform