简体   繁体   中英

FoxPro/VFP CREATE SQL VIEW slowness on Windows 7

I'm having a problem with vfp9 on Windows 7 64-bit. I've found that create sql view is taking 5-6 seconds. These happen instantaneous in XP. When my app starts up, I'm doing a few of these, so in Win 7, my app is taking 30+ seconds longer to start up than in XP. My views look like this:

create sql view MyView remote connection MyConn as select * from MyTable

I've also found that calling dbsetprop is adding another 1-2 seconds in Win 7. Again its instantaneous in XP.

dbsetprop('MyView.MyPk', 'Field', 'KeyField', .T.)
dbsetprop('MyView.MyPk', 'Field', 'Updatable', .T.)

Once created, the views work as they should. No slowness on with platform.

Does anyone have any ideas about what I could try or any info on what is/could be causing this?

Thank you in advance.

I don't know why as I haven't worked with Windows 7 yet with VFP... However, what I would check within VFP and try changing some settings to see if it helps.

From the VFP/IDE menu, go to Tools, then Options. On the multi-tab form, click on the "Remote Data" tab.

I don't know if/what its trying to do, but maybe for testing, make sure the "Records to fetch at a time" is NOT set to "All" (checkbox).

I would also look into SQLSETPROP() function to see if any of those settings might help.

I can't reproduce this on Windows 7 64 bit, either with VFP9 RTM or VFP9 SP2. I don't have a database of any size to work with but on the sample database Northwind the commands you list seem to work instantaneously.

A couple of questions:

  • Is this reproducible on any machine running Windows 7?
  • Where is your database? Is it on the local machine, a local network, or the internet?

There seems to be more scope for speed problems with Windows 7 and Visual FoxPro (and similar) applications, and I think this is down to the different network stack in Windows 7, immature network card drivers, an increased susceptibility to cabling and network switch problems, or any combination of these.

Ensure that all your Windows 7 boxes are on SP1 (and any Server 2008 boxes with shared DBF files also), as this fixes a file corruption issue that affected Visual FoxPro indexes.

Ensure that your network card drivers are 100% up to date. This can make a big difference.

One thing that I have seen which can give a massive improvement to the speed of networked Visual FoxPro applications is the network card driver Interrupt Moderation setting. This is present on Intel, Broadcom and many other NICs, although with possibly slightly different names.

I have personally seen situations where disabling this has changed a networked VFP application from taking 30 seconds to start to about 6 seconds.

Found the solution.

Write caching was being disabled on the drive by the raid controller software included with the machine.

Write caching was enabled under Device Manager > Disk Drive > Properties > Polices. However the software was overriding this setting.

It can be reproduced without the raid software by unchecking it in Windows 7 Polices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM