Mastercard Interview Question | Solution

Question

State one situation where the set-based solution is advantageous over the cursor-based solution.

in progress 0
Dhruv2301 4 years 2 Answers 902 views Great Grand Master 0

Answers ( 2 )

  1. Set-based solutions provide better performance as they work on a result set and not on one row at a time. They are concise and more readable.

  2. When you are processing huge amounts of data, set based query will generally
    make use of multiple threads of the database engine and process it faster, whereas
    cursor will generally go sequentially and make use of single thread.

Leave an answer

Browse
Browse