Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select WITH Buffering = .t.
Message
From
14/07/2006 18:56:40
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01136217
Message ID:
01136588
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform