Performance: Select field VS Select RTrim(field)

  • Hi,

    Is there any performance penalty if I use RTrim() to trim a field? On a hand RTrim is a simple function. On the other hand the database server needs do it for each selected row. So don't know overall how it affects the performance.

    Thanks.

    Michael

  • Presentation issues are better handled on the client rather than the server. Even a simple function takes time. However, depending on your data, and your objective there may be times when it is necessary to use RTrim. So the answer is it depends. which I know is not the answer your were looking for. As a general rule if it is a presentation issue do it on the client.

    HTH

    Mike 

  • You could also compare the query execution plan in QA "with" and "without the function" in your query to see what differences there are....







    **ASCII stupid question, get a stupid ANSI !!!**

  • I think the function might necessiate a materialization of the data in tempdb, such as an order by or a group by does.

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

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