Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT Optimization BUG or Limit ?
Message
From
02/05/2003 10:33:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
SELECT Optimization BUG or Limit ?
Miscellaneous
Thread ID:
00784112
Message ID:
00784112
Views:
56
Hi all

CREATE CURSOR ctop (dato I)
INSERT INTO ctop values(1)
INSERT INTO ctop values(2)
INSERT INTO ctop values(1)
INSERT INTO ctop values(2)
z=6
SELECT *,m.z Z from ctop WHERE m.z>1 AND cycle()
* 6-5-4 are used for the analysis of the select

* RESULTS
* 1 3
* 2 2
* 3 1

z=1
SELECT *,m.z Z from ctop WHERE cycle() AND m.z>1
* analysis of the select optimize WHERE :
* m.z is a variable, then it is costant !!!!
* m.z>1 is costant and false, then WHERE is costant and false
* WHERE is costant and false -> none results
* RESULTS
* none

* idem for Object.properties

* good optimization is for litteral expression
* this bad optimization not exist in MSQL

* where is document this beaviour ?

* the master optimization rule is:
* no optimizer algorithm is perfect,
* therefore I must be able to disable it.
* THE BIG PROBLEM IS : I CANNOT DISABLE SELECT OPTIMIZER !!!!

PROCEDURE cycle
z=z-1
ENDPROC

Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform