Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relative performance of views, queries & SQL-SELECT
Message
From
05/11/1998 17:51:47
Craig Mcclelland
Computer Fiscal Services
Sydney, Australia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00154597
Message ID:
00155048
Views:
19
Barbara,
thanks for the suggestions.

I have never used views so I have very little understanding of them.

I have been told by a fellow programmer that as a general rule using VIEWS is much more efficient than just running the equivalent SQL-SELECT and using the resulting cursor/table in subsequent processing (assuming that updating the base tables is not a requirement).

The subsequent processing would basically be a SCAN of the entire table/view to perform some format changes etc then copying the table/view to a text file.

In this sort of situation would there be any performance benefit in using a VIEW?

Thanks
Craig.


>Craig,
>
>Here's my $.02 US:
>
>You shouldn't bother with a View, since you don't need to update the tables involved. Views are a) stored in the DBC and b) allow you to update the data in the base tables. In your case, neither of these items is important. I have never found a reason to use a Query (as a QPR file), and can't tell you any advantages to using that format. Straight SQL will be easier to change if your base table structure changes and you don't need to fill up your DBC.
>
>If I understand what you want, I'd run SQL to get the first cursor, USE it AGAIN to get a read/write cursor and do my updates/conversions on the read/write cursor and then copy it to the text file.
>
>HTH
>Barbara
>
>>I am after some general advice on the relative performance of views, queries or using SQL to generate intermediate tables.
>>
>>Roughly, the situation is as follows...
>>I will be generating an extract from a Foxpro database (destined for a comma separated text file).
>>The extract requires 3 tables to be joined & some filters to be applied.
>>The extract will normally include about 95% of records from the primary table (after some are filtered) plus related records from the other tables.
>>There could be up to 300,000 records in the primary table.
>>
>>Some conversions etc have to be performed on the result set before it is output to a text file.
>>All the tables are local.
>>
>>Would there be any significant performance differences between say views or just executing SQL-SELECTs to generate this type of extract?
>>
>>Any tips or comments would be greatly appreciated.
>>Thanks
>>Craig
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform