>For some reason, I did not think of creating views for the FoxPro 2.6 tables. So, I tried it on a small table and that worked, but when I tried it on a big one (3.7 million records), VFP took forever to open the view. How can I get around this?
>
>Also, I need access to the table's indices (CDX) for querying. How do I handle that without recreating them everytime I open the view?
>
>It sounds like using views will separate the Business Logic from the data. Now, I just need to get it to work.
>
>Thanks again for you help!
When you do use you should use mostly parameterized views. This is also probably the most like scenario with business objects or middle tiers. You deal only with single records or sets of records. You only select the records you need to work with. The SQL query making up the view will use the CDX files but once you have the data (usually a small subset) you don't need indexes.
You mentioned that you might be going to remote data, so the application should be written as if you already are. This means working with sets of data. (Your remote views will pretty much require parameters if you don't want to be continually sucking down hugh record sets).
With small tables (like codes, etc) you might have a view that includes all records but with large tables your views should have parameters to limit the result set. You just REQUERY() the view as your parameter changes.
I have a new rule in my projects to code only to views so that it will be simple to change from DBF's to SQL-Server data. Now, all my data retrieval is in sets of records.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement