FreeTDS question about text size

"Jacopille, David" <[email protected]> Fri, 5 Oct 2018 21:39:41 +0000
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
General question for a FreeTDS guru:

We saw the warning in the freetds.conf file:

        # If you get out-of-memory errors, it may mean that your client
        # is trying to allocate a huge buffer for a TEXT field.
        # Try setting 'text size' to a more reasonable limit
        text size = 64512

We needed more but we still tried to be reasonable:

        #text size = 64512
        client charset = UTF-8
        text size = 200000

Of course we encountered a nvarchar(max) column that is holding way more than 200000 bytes and it seems to be getting truncated.

What is the impact of increasing text size to 10 MB?

Are any of these three scenarios true?

A.   Every column, even an nvarchar(8), is allocated 10 MB
B.   The memory utilization is only what the column actually holds...up to 10 MB
C.   The memory utilization is determined by table design: an nvarchar(8) col would be allocated 16 bytes, and an nvarchar(max) would be allocated 10 MB

Thanks,
Dave

MFS Email system made the following annotation
---------------------------------------------------------------------------------------------------------------------------------------
This email communication and any attachments may contain proprietary, confidential, or privileged information. If you are not the intended recipient, you are hereby notified that you have received this email in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. The sender does not waive confidentiality or any privilege by mistransmission. If you have received this email in error, please notify the sender immediately, delete this email, and destroy all copies and any attachments.