Hi, I've always wondered why in SQL traces I see Dynamics NAV always shooting SELECT * FROM... commands. Is this a developer problem or a platform problem? If is the latter, can this behavior change without the creation of additional objects i.e. Views?
0
Answers
Query objects are NAV's way to let you (as a developer) access your data in a more efficient way.
But anyway, thanks @vaprog for taking the time to answer this one
As you have already probably understood, I'm not a Dynamics NAV developer , I'm a DBA
As for the BLOB fields - it is not efficient, but a good NAV developer knows that and does not put a BLOB into table which needs to be frequently accessed. He/she puts the BLOB into separated, integer-keyed table instead, and in frequently accessed table keeps only the reference to the blob field holding table.
See the Interaction Log Entry / Attachment table for example.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Also if you want to create new Indexes,Keys for performance do it in Dynamics NAV because if Objects in Dynamics are compiled every operation made on SQL for the obejct is lost.
I had to learn it the hard way.
best regards,
> The NAV as a platform does not know if you are going to need a field or not. the FIND* command is the platform command, what are you going do do with the record later is not a platform concern. In one place you may use one field down the code, in another place few other fields. How the FIND platform command is supposed to know which field are you going to use after it, later in the code ?
>
> As for the BLOB fields - it is not efficient, but a good NAV developer knows that and does not put a BLOB into table which needs to be frequently accessed. He/she puts the BLOB into separated, integer-keyed table instead, and in frequently accessed table keeps only the reference to the blob field holding table.
>
> See the Interaction Log Entry / Attachment table for example.
>
> Slawek
Hi Slawek,
Thanks for your reply. I understand your point, I just thought that it could be something like a SELECT statement where you can ask for the fields you need. As this seems to be predefined in NAV C/AL, there's not much anyone can do on that side.