Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Curious about Excluded Fields
 

Pages: 1
LLBLGen Pro Runtime Framework
Curious about Excluded Fields
Page:1/1 

  Print all messages in this thread  
Poster Message
simmotech
User



Location:

Joined on:
01-Feb-2006 15:43:00
Posted:
1006 posts
# Posted on: 08-Sep-2017 08:48:47.  
I was just curious about the reason behind fetch queries using "NULL AS [xxx]" for excluded fields.

I guess it was to have a one to one with the entity fields into which the results will go but wouldn't it be just as easy to exclude those fields from the query and match returned results by field name?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37455 posts
# Posted on: 08-Sep-2017 10:01:41.  
It's an optimization trick Regular Smiley We had what you suggest before, I think before 4.2, not sure, but then the resultsets are different if you do or don't exclude fields. That would mean to materialize an entity we needed to read/write each field value individually (as it could be on a different ordinal in the row).

By returning NULL for an excluded field, the resultsets for a query with and without excluded fields is the same, so we can then simply pull the full row from the datareader and store it in the entity in 1 go. This is much faster than reading fields individually Regular Smiley


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.