Position of a varchar in a record

  • I remember a performance tip of another DBMS: put varchar's (or nvarchar) at the end of a record. If there is a field (an int for instance) that is queried and has its position after a varchar, the DBMS, instead of having a predefined position, has to compute the position of the field, taking into account the length of the varchar. And this would take time.

    Is this also the case in SQL Server???


    Kindest Regards,

    Gimli

    If you are a spineless creature, they can't break you

  • This is not the case for sql server. sql server can store many rows per page, so the relative position in the row of a column is irrelevant. sql server still must go thru the same pages to get the required data.

    I have not read anything to think this is an issue, and not experienced any problems.

  • I found out the answer. Although you place a varchar in the middle of a row. The physical placements of varchar's are a the end of a row. So SQL resolves the problem here.


    Kindest Regards,

    Gimli

    If you are a spineless creature, they can't break you

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply