SunQuest
           Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 27th, 2003, 12:47 PM
kcashel kcashel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Washington, DC
Posts: 2 kcashel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Speed for FoxPro / VB

I've written a windows program in vb.net that employs ADO/ODBC via a DSN-less connection to a FoxPro database. The biggest table has over 60,000 records. It works well with one user, but was built so a second person could work concurrently over a network.

The problem is, it works at a crawl for the remote user. A query which returns only a couple of dozen records can take almost 8 seconds to run. I've read that RDO would be faster, but it seems rather strange to port it backwards (plus, I can't get RDO to work in .net, a whole separate question). Also Microsoft has released an OLEDB connector for the latest version of FoxPro, which works faster than ODBC, but it's still not ideal.

Is there any way to get this thing up to an acceptable speed? Seems like vb.net may not even be the right tool for the job. I'm new to this, and am open to any advice on which direction I should proceed.

Thanks in advance.

Reply With Quote
  #2  
Old August 27th, 2003, 05:23 PM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 8 h 5 m 34 sec
Reputation Power: 20
I am not familiar with FoxPro, but there is a distinct possiblity that the work is actually being done locally, meaning the entire table is hoovered across the network and then processed. I have heard that Access does the same thing. I believe that FoxPro (like Access) is not run as a server bound to a specific machine but is launched each time the database is accessed. You can look into using something free like Postgresql and cygwin (or that costs $$ like Oracle or SQLServer) and probably get the performance you are interested in.
__________________

Left DevShed May 28, 2005. Reason: Unresponsive administrators.
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
  #3  
Old September 1st, 2003, 03:08 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
The Visual Foxpro OLE DB provider/ODBC driver is not client-server. It is the Visual Foxpro database engine that run locally and exposes OLE DB/ODBC interface to clients. So, if you have queries, the OLE DB provider will run locally the foxpro engine, open the database/tables from shared folder, and then retrieve the resulting record set.
Anyway, the Foxpro database engine can handle queries against milions of records in sub-second execution time even with shared network acces if:
-the resulting record set is small (the same apply for other servers)
-you have the database designed for fast queries ( queries that can use Rushmore technology)

Rushmore technology speeds up data acces thousands of times, using existing indexes, so I recommend you to create indexes using fields/expressions involved in SQL query.
If you post the code for queries, maybe I can help you.

Reply With Quote
  #4  
Old September 2nd, 2003, 10:25 AM
kcashel kcashel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Washington, DC
Posts: 2 kcashel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the responses... that sounds very promising, badukist.

One of the main SQL queries follows. strFilter is the last name, which the user has typed in, and all the fields used here have already been indexed:

"SELECT * FROM hsin WHERE upper(lname) LIKE '" & UCase(strFilter) & "%' ORDER BY lname, rname, suffix"

Reply With Quote
  #5  
Old September 3rd, 2003, 04:36 AM
badukist badukist is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 62 badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level)badukist User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 3 m 18 sec
Reputation Power: 7
Send a message via Yahoo to badukist
Looks like you need an index on upper(lname)
Let me elaborate a bit:
If you have an index on upper(lname)...
The expression

upper(lname) LIKE 'JO%'
is optimizable, partially but very fast (portions of index will be downloaded locally and a list of records will be built based on filtered index keys, then only matching records will be downloaded from source table)

upper(lname) like '%JO%' is not optimizable and all data from table will be downloaded to find matching records.

upper(lname) = 'JO' is fully optimizable (the fastest) and can be used to retrieve the same result as LIKE 'JO%' if SET ANSI OFF.
If SET ANSI is ON, 'JO' will be padded with spaces to find matching records.

If you don't have index on upper(lname) then all data from table will be transferred to find matching records.

Hope this help

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Speed for FoxPro / VB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway