Optimizing data projection queries ($select) #228
-
An OData query with a simple projection like SELECT [o].[Id], [o].[OrderDate], [o].[OrderType], [o].[Weight], [o].[MaterialValue], [o].[Currency], [o].[OrderStatus]
FROM [order].[Order] AS [o]
ORDER BY [o].[Id] What I'd expect would be a SQL query like this: SELECT [o].[Id]
FROM [order].[Order] AS [o]
ORDER BY [o].[Id] This is especially hurts performance when additional tables are joined. The OData controller implementation is as simple as: public async Task<ActionResult<IQueryable<Order>>> GetAsync(ODataQueryOptions<Order> options)
{
var results = await _dbContext.Orders.GetQueryAsync<Dto.Order, Entity.Order>(_mapper, options);
return Ok(results);
} Is there an issue somewhere in the implementation/configuration or is this just not supported? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The tests show that |
Beta Was this translation helpful? Give feedback.
The tests show that
$select
works. Maybe you're missing explicit expansion in your configuration. See the ReadMe.