Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursoradapter and big tables
Message
From
31/01/2014 17:56:11
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01592787
Message ID:
01592792
Views:
79
>I know that probably this question has been asked before but i haven't been able to get the answer i have been looking for.
>
>let me explain you guys in detail the scenario:
>
>1. I have a table PREmployees,
>2. The employees for this customer are about 2,000 people
>3. The application was requested to store an historic of every week, so it is 2,000 records per week, so more than 100K records a year
>4. I am using a CursorAdapter parametrized for bringing only the records for an specific week
>5. when the screen opens , the Cursorfill fires and brings 2,000 records for the specified week
>6. The user can change the week as discretion so all years, all weeks must remain on the table
>7. On the screen there is an option to display a search window
>8. i am using odbc with a shard connection handler
>
>the problem:
>when i run the screen on the server takes a couple of seconds, but when the users runs it on their desktop through the network, takes a little more, probably a minute or so
>
>what i am looking for:
>1. an idea on how to reduce the time consuming for the user when opening the screen
>2. understand if fetchasneeded might help with out affecting my search window cause in order to search uses the Cursoradapter resultset, all 2000 records
>3. for me 500K records is not that much, but is taking to long to retrieve, i might be doing something wrong?
>
>what i am not looking for
>1. ideas on how to split table. not interested in this
>2. stop using CA, not an option, my whle system is bases on this
>
>tnx in advance

Never expect the performance on the server (local access to data) to be the same as the user (remote access to data). The question has to be what to do to improve user performance as much as possible.

1 - Show the user a grid of records. If there are 5 columns for that grid, only grab 5 columns x 2000 rows. When the user wants to access a particular record, grab all the fields for that record. If there are 50 columns on the table, doing 1 query = 50 * 2000 rows which is 100000 cells of data. If you only grab 5 columns x 2000 rows that is 10,000 cells. 1/10th the data will give you much more speed. You do not need ODBC for FoxPro to grab FoxPro data with cursoradapter.

2 Ask the user for the employee id or name and only pull those records.

3 Do you have the correct indexes? On the server foxpro can seem so fast that you may think you do not need indexes. You do need them. Show the SQL command you are running, and the indexes on the table please.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform