Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Large tables
Message
From
29/06/2005 21:31:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
29/06/2005 21:12:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01027560
Message ID:
01027563
Views:
21
>We have two sites that are some 10 miles apart, and these sites are connected via a T1 line. The server resides at one of the sites. On the server, there is a table called patient.dbf that has over 2 million records in it, with about 50 fields per record. A user only needs to see one record at a time.
>
>When the table is opened with the USE command at the same site as the server resides at (ie does not send data across the T1), the table opens instantly. When it is opened with USE at the site remote from the actual server machine, it opens painfully slowly.
>
>If we use a SELECT-SQL command to select just one record from the table at either site, the entire table seems to be opened in the current work area in order to execute the selection. That's not a problem at the 'local' site, but again, creates an incredible drag when executed at the remote site.
>
>How does one 'select' just one record from a very large table without actually causing VFP to open the entire table in its own workspace?

An index on the key field should help reduce the amount of data transfered. For example, if you:
select * from MyTable;
  where MyKey = lnMyKey
since you will usually have SET DELETED ON, this will implicitly result in the condition: ... where MyKey = lnMyKey and not deleted(). It would therefore help to have an index on field MyKey. It would also help not to have an index on deleted(), since otherwise, the entire index will be transferred for the "optimization" process (since almost all records fulfill the condition). (In case of doubt, test both with and without the index on deleted()).

For updating the record back to the base table, use a view instead of an index.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform