Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very slow result in report
Message
From
12/02/2005 20:03:37
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00985559
Message ID:
00986363
Views:
21
Hi Lisa,

>Thank you Fabio. I see what you're driving at, partly, but:
>
>
>It is relevat, COUNT,SUM,CALCULATE,AVERAGE are fully optimized
>when the optimization index is the current order,
>

>
>First, how do you know that it is fully optimized? Is this by virtue of observed performance, or by other means?

By observation.
Of course, you can beat again that the observation does not describe the mechanism, but only the effect, and the explanation has constructed a model ad hoc that it accidentally explains the observation. But this is the eternal problem of physics, inasmuch as the universe we have not made it.
The problem is that often who makes something does not know what ago,
and the result is fortuitous and derives from one logical tie series.
Then, with the observation could be reconstructed a something that nobody has created.

>
>Second, optimization is supposed to use all available indexes, so I am not sure what it means to say that something is "fully optimized when the optimization index is the current order". <s>
>

Optimization level:
Fully : time=k1(ResultRecors,LOG(RECCOUNT()))
Partial : time=k2(ResultRecors,LOG(ResultRecors),LOG(RECCOUNT()),RECCOUNT()
None : time=k3(ResultRecors)*RECCOUNT()

Normally VFP uses partial optimization on dbase command
when the table have not the RECNO() order,
and the VFP cannot use the index btree order for run into the table directly,
but must reorder this with the current index

>Third, I really can't see how my code proves your point <s>. While I do understand that EXACT plays a part, and so do other artifacts like padding of strings, what I don't understand is how my code could prove that Fox is using the index (or not).
>

Now, we use a INTEGER, therefore SET EXACT is outside from the argument.
Please, run this.
ACTIVATE SCREEN
CLEAR
CLOSE TABLES all
SET TALK OFF
SET DELETED OFF

? 'RECCOUNT','FULL' AT 15,'PARTIAL' AT 30,'NONE' AT 45
CREATE CURSOR TEST  (F1 I)
FOR J=1 TO 10
	SET INDEX TO
	FOR K=1 TO 100000
	 INSERT INTO TEST VALUES (0)
	NEXT
	 INSERT INTO TEST VALUES (1)
	INDEX ON F1 TO SYS(2023)+'\tempIndex' && uses not compact IDX becuse it is faster
	TEST()
NEXT
*INSERT INTO TEST VALUES (1)

PROCEDURE test
? RECCOUNT()
GO TOP
t1=SECONDS()
COUNT  FOR 1=F1	&& time = o(_tally*log(reccount())
?? STR(100000*(SECONDS()-t1)/log(reccount()),15,4)


GO TOP
t1=SECONDS()
COUNT  REST FOR 1=F1	&& time = o(RECCOUNT())/FACTOR
?? STR(100000*(SECONDS()-t1)/RECCOUNT(),15,4)

GO TOP
t1=SECONDS()
COUNT  NOOPTIMIZE REST FOR 1=F1	&& time = o(RECCOUNT())
?? STR(100000*(SECONDS()-t1)/RECCOUNT(),15,4)
As you can see, when an index is active,
the optimization can reduce a lot.
ill-fatedly, for locate, replace scan ,set filter ...,
VFP it always uses the partial optimization,
also when full optimization could use one.


Lisa, We omit SELECT SQL,
otherwise you say to me what I know
and I say to you what you know.
A beautiful lesson for the readers, but....

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform