Firstly: a great question, and someone asked about this time! :-)
Yes, the fact that ORM usually returns all columns for a database table is something you need to consider when designing your systems. But, as you already mentioned, there are ways around this.
The main fact for me is for this to happen - either SELECT * FROM dbo.YourTable , or (better) a SELECT (list of all columns) FROM dbo.YourTable .
This is not a problem when you really need the whole object and all its properties, and as long as you load a few lines, this is also great - convenience exceeds raw performance.
You may need to think a little about changing database structures: for example,
perhaps place large columns, such as BLOBs, in separate tables with a 1: 1 link to your base table. So choosing in parent tables doesn't capture all these big drops of data
it is possible to put groups of columns, which are optional, that can only be displayed in certain situations, into separate tables and link them - again, to preserve the lean'n'mean base tables
Also: Avoid trying to βarmβ your ORM to perform massive operations - this is simply not their forte.
And: keep track of performance and try to choose an ORM that allows you to modify certain operations, for example. stored procedures - this allows Entity Framework 4. Therefore, if the hits kill you - perhaps you just write the stored procedure Delete for this table and process this operation in different ways.
marc_s
source share