Performance / INSERT(FALSE) etc

boywonder
Member Posts: 179
Just read this...
"Try to structure the code so that it does not have to examine the
return values of the INSERT, MODIFY, or DELETE functions.
When using the return value, the server has to be notified right away
so that a response can be obtained. Therefore, if they are not
necessary, do not look at these return values."
So help I'm not 100% clear what this is saying (my english!) -
Does it mean...
MODIFY(FALSE) is bad and instead it should be just MODIFY...
I hope so because that's what I've always done unless the OnModify trigger is needed in which case MODIFY(TRUE)
"Try to structure the code so that it does not have to examine the
return values of the INSERT, MODIFY, or DELETE functions.
When using the return value, the server has to be notified right away
so that a response can be obtained. Therefore, if they are not
necessary, do not look at these return values."
So help I'm not 100% clear what this is saying (my english!) -
Does it mean...
MODIFY(FALSE) is bad and instead it should be just MODIFY...
I hope so because that's what I've always done unless the OnModify trigger is needed in which case MODIFY(TRUE)

0
Comments
-
boywonder wrote:it does not have to examine the
return values of the INSERT, MODIFY, or DELETE functions.
It has nothing to do with (TRUE) or (FALSE). These two parameters change the business logic. INSERT(FALSE) will perform an insert without executing any validation code.
What this means is that you should avoid writing IF INSERT THEN... or IF NOT MODIFY THEN...
IF COMMAND returns a boolean value indicating a successful / unsuccessful command.0 -
It says only use
IF Record.INSERT THEN; IF Record.MODIFY THEN; IF Record. DELETE THEN;
when you have to. When you do the code like this the server has to send a response in order to know how to move forward. When you just do a normal INSERT/MODIFY/DELETE it moves to the next line of code without waiting.0 -
makes perfect sense now - thank you so much0
-
i'm just "adding a cherry on the cake"...
there's no problem in usingIF NOT mytemptable.INSERT THEN mytemptable.MODIFY
structure (supposing that mytemptable IS a temporary table variable) as it does not imply any server call/response.
This is obvious, but it's useful to know, as it is a comfortable way of managing temptables, if you need it0 -
Checking the return value of INSERT disables the use of bulk inserts.Microsoft Dynamics NAV automatically buffers inserts in order to send them to SQL Server at one time.
By using bulk inserts the number of server calls is reduced, thereby improving performance.
Bulk inserts also improve scalability by delaying the actual insert until the last possible moment in the transaction. This reduces the amount of time that tables are locked; especially tables that contain SIFT indexes.
Application developers who want to write high performance code that utilizes this feature should understand the following bulk insert constraints.There are no bugs - only undocumented features.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions