We are currently studying the load on our SQL server and are exploring ways to eliminate it. During my post-secondary education, I was always told that, in terms of performance, it was cheaper to get SQL Server to do the job. But is this true?
Here is an example:
SELECT ord_no FROM oelinhst_sql
This returns 783119 records in 14 seconds. The field is char(8), but all of our serial numbers are six digits long, so each of them has two empty characters. Usually we crop this field, so I performed the following test:
SELECT LTRIM(ord_no) FROM oelinhst_sql
This returned 783119 records in 13 seconds. I also tried another test:
SELECT LTRIM(RTRIM(ord_no)) FROM oelinhst_sql
There is nothing to focus on the right, but I tried to find out if there is overhead in the simple action of calling the function, but it still returns after 13 seconds.
, SQL , . , - , SQL , . ?