Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best index expression?
Message
From
19/04/2005 14:05:22
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01005870
Message ID:
01006296
Views:
19
Hi Nadya,
>Thanks, I'm going to put it up.
>It gave 2 sec. degradation, but I think, it's within the calculation error [how to say correctly - pogreshnost']

You should lower the calculation error <g>! But since I was not sure about the actual time needed
clea
LOCAL ln1, ln2, lnRun, lnTimes, lnStart, lnTst
CREATE CURSOR t1 (Test1 c(30))
SELECT t1
ln1 = SELECT()
CREATE CURSOR t2 (Test2 c(30))
SELECT t2
ln2 = SELECT()
lnTimes = 1000000

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	lnTst = SELECT()
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	SELECT t1
	SELECT t2
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	SELECT (m.ln1)
	SELECT (m.ln2)
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	SELECT (IIF(.t., "t1", m.ln1 ))
	SELECT (IIF(.t., "t2", m.ln2 ))
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	SELECT (IIF(.f., "t1", m.ln1 ))
	SELECT (IIF(.f., "t2", m.ln2 ))
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	IF .t.
		SELECT t1
	ELSE
		SELECT t2
	endif
	IF .f.
		SELECT t1
	ELSE
		SELECT t2
	endif
NEXT
? SECONDS()-m.lnStart

lnStart = SECONDS()
FOR lnRun = 1 to lnTimes
	IF .t.
		SELECT (m.ln1)
	ELSE
		SELECT (m.ln2)
	endif
	IF .f.
		SELECT (m.ln1)
	ELSE
		SELECT (m.ln2)
	endif
NEXT
? SECONDS()-m.lnStart
regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform