Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select WITH Buffering = .t.
Message
De
14/07/2006 18:56:40
 
 
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 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01136217
Message ID:
01136588
Vues:
29
>I think we need to work with my colleague on a different algorithm. I do, of course, appreciate some input on the problem from MS or from Fabio, but our experiments proved BUFFERING = .T. to be a culprit.

Buffering slow down every operation a lot,
this is true with buffering=.T., too.

WITH buffering = .t. vfp doesn't optimize every buffered record
( this is not necessary for me, and VFPT can optimize the query )

try this extreme case, with an exclusive cursor.

When reccount doubles, time quadruples:
CLEAR

CREATE CURSOR testbuffering (pk i autoincr, field1 L)
FOR k=1 TO 50
	INSERT INTO (ALIAS()) ( field1 ) VALUES (.F. )
NEXT

* build an index is useless
* INDEX ON PK TAG TPK

FOR k=1 TO 4
 INSERT INTO (ALIAS()) (field1) SELECT .f. FROM ALIAS()
 testtime()
NEXT

PROCEDURE testtime()

CURSORSETPROP("Buffering",5)

* allocate memory
test(.f.)

? RECCOUNT(),"records in buffer: NONE"," buffering False" at 40, test(.F.) at 60, " True" at 80, test(.T.) at 90

REPLACE all field1 WITH field1

? RECCOUNT(),"records in buffer: ALL"," buffering False" at 40, test(.F.) at 60, " True" at 80, test(.T.) at 90

TABLEREVERT(.T.)
CURSORSETPROP("Buffering",1)

PROCEDURE test(buffering)
	t1=SECONDS()
	SELECT COUNT(*) FROM testbuffering T1 ;
					JOIN testbuffering T2 with (buffering=M.buffering);
						ON T1.PK=T2.PK;
			INTO ARRAY ASELECT
	RETURN SECONDS()-T1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform