Why Microsoft doesn´t change all FIND(-) for FINDSET?

nav_studentnav_student Member Posts: 175
edited 2011-10-24 in SQL Performance
I just export all objects from a Cronus database (2009 R2) to txt and find out many FIND('-') on all the code.
If this kind of command creates a lot of cursor´s wich cause a lot of impact to SQL performance why Microsoft doesn´t do a full review and changes this kind of commands, or are they helpfull on some processes?. Can you help me?

Best Regards,

nav_student.

Comments

  • DenSterDenSter Member Posts: 8,304
    Because it depends on the situation what it needs to be replaced with, and sometimes you don't replace it at all. You can't do a straight find/replace, that is going to cause a LOT of problems.
  • nav_studentnav_student Member Posts: 175
    Thanks DenSter for your answer.

    So what kind of situations do you refer.

    How to know what FIND is the best?
    Probably it´s a basic question but i´m a rookie.
  • krikikriki Member, Moderator Posts: 9,094
    And it is an immense lot of work to do.
    So they only do it if they happen to change/add code.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • nav_studentnav_student Member Posts: 175
    I understand that a lot of work, but changes like that im my modest opinion :oops: could increase significantly the performance of the product on the next release.

    Don´t you agree?
  • DenSterDenSter Member Posts: 8,304
    It's all a matter of priorities. Say you have 10 hours available to work on something, and there is a list of 500 tasks that all take just 10 minutes. Obviously there is not enough time to do everything, so you make a choice which ones are most important to you, and you feel like you did an excellent job.

    Then someone comes in and sees that you did not do this one task and starts yelling at you "That only takes 10 minutes! That is just crazy that you did not do it!". Do you think that is reasonable?
  • krikikriki Member, Moderator Posts: 9,094
    Agreed that it would increase performance.

    But a higher priority are the things that don't work and after all:slow performance does not mean that it doesn't work.

    And even if Microsoft is BIG, they still don't have unlimited resources.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • JasminkaTJasminkaT Member, Microsoft Employee Posts: 34
    Because it depends on each installation and data volume. It's only useful when expected number of hits will be within range specified with RecordSet database parameter. This parameter has default value of 500 (on nav 5.01) and 50 (NAV 2009 SP1).
    So if number of records retreived by loop is expected to be less then this number, then FINDSET should be used rather then FIND('-').
    Otherwise there is no point, there will be no performance gain (cursors are not creted only for first X (=recordset) records retreived by the loop).
    Don't feel tempted to increase recordset value though, it allocates absolute amount of client memory for each call=> memory consumption by client increases with increased value of this parameter. Rule of thumb: recordset= average no. of lines in an order.
    Also, if modifying record within the loop, one has to consider additional parameters for the FINDSET command.
Sign In or Register to comment.