Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the best index expression?
Message
De
19/04/2005 14:05:22
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01005870
Message ID:
01006296
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform