cancel
Showing results for 
Search instead for 
Did you mean: 

Does GRAPHICAL_PLAN() actually execute an UPDATE?

Breck_Carter
Participant
871

I think the answer is "No, a call to GRAPHICAL_PLAN() will at most execute the query portion of an UPDATE statement but it won't actually update any rows or execute any triggers."

The following SQL produced the attached plan for a single-row UPDATE that takes 30 seconds to execute; the attached plan shows the UPDATE as taking less than 1 second to run:

      CALL xp_write_file ( 
         STRING ( 'C:/TEMP/plan_for_update_', @sampling_id, '_', @sample_set_number, '.saplan' ),
         GRAPHICAL_PLAN (
            'UPDATE rroad_sample_set
                SET rroad_sample_set.sample_finished_at = @foxhound_probably_stopped_at
              WHERE rroad_sample_set.sample_set_number = @sample_set_number',
            2, -- Detailed statistics including node statistics
            'asensitive',
            'READ-ONLY' ) );

Accepted Solutions (0)

Answers (0)