Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed up SQL queries with your mouse!

Status
Not open for further replies.

finsys

Programmer
Jan 31, 2002
56
0
0
GB
Yes, you read it right. If you have a remote view to SQL server and it's taking a long time to retrieve the records, you can speed it up with your mouse!!

I noticed this whilst retriving 1m records in a view (VFP7 and SQL2k). It was pulling back 100 records every 0.5s (the speed the status bar record count was updating). Whilst sitting bored stiff, waiting for the data to come back, I mindlesly starting moving the mouse about. To my surprise the record count started to shoot up to about 5000 records per second!! [surprise] If you stop moving the mouse, the count slows up again. Move it, it speeds up! We tested it on a collegues PC and it worked on that too.

Anyone ever seen this before?? Could be an interesing one to report to Microsoft if they don't already know about it.
 
It would be interesting to report.
DOEVENTS in certain vfp versions ran much slower when there were no events to view (I think it would wait for a clock-tick event before returning, or a timeout or something).

Moving the Mouse causes loads of events that would return immediately. Is there a "DOEVENTS" in your feedback code that reports the number of records retrieved? This is probably the cause of the strange behaviour.

It is reported that this DOEVENTS issue is fixed by vfp8... I don't know if it was fixed in vfp7.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Bill,

I think you've got the answer. At least, it sounds plausible.

The DOEVENTS problem you mentioned was fixed in 7.0. It made a big difference to the speed of a loop where you needed to check for a "cancel" action each time round the loop.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Hi chaps,

This isn't in a program! I'm browsing the remote view after clicking on the Browse button in the project manager! No code or events running.

In case you're wondering why I'd be mad/stupid enought to do that, it was so I could run some code against it once all the records had been retrieved.

cheers
Ric
 
In that case, I think that there is an internal call to the event processor while VFP is loading the remote view, probably primarily to watch for the ESC key, and this event processor must have the same problem that the older VFP DOEVENTS had.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top