This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have tables that can have up to 700 columns in them - statistical datasets. Is there a way to return a subset of these columns instead of all of them? The standard build of a query by lightspeed seems to retrieve all columns of a table, which on a table with this number of columns would have a negative performace impact on data retrieval.
Thanks |
|
|
There are two ways to do this depending on the requirement: 1. If you just want to retrieve a bunch of columns as a record, you can use a projection: var prices = unitOfWork.Products.Select(p => new { p.Name, p.Price }); 2. If you want to retrieve the data as entities, but not loading the extra columns, you can mark those fields as being part of a named aggregate. This will cause the fields to be loaded only on demand or if the aggregate name is specified in the query. See http://www.mindscapehq.com/documentation/lightspeed/Performance-and-Tuning/Controlling-How-Entity-Data-Loads |
|