I have simple select query like this SELECT str FROM table WHERE parent_id=5
Which will return thousands of rows.
I need to count how many characters on selected rows.
I thought 2 ways to do this.
1) Combine all rows to single string and use strlen
function. (Looks simple but it will probably consume a lot of memory due to very long string)
2) Return size of selected rows in bytes and divide it to single char size according to used encoding. (I don't know how to calculate size of selected rows)
Which one will less load to server or reasonable way to do this? Thanks