[Solved] Where do I find the meaning of TdsInputBufferError numbers?

EverSQL Database Performance Knowledge Base

Where do I find the meaning of TdsInputBufferError numbers?

Database type:

We are having some sporadic connection errors on some of our SQL servers. I did some searching and found out about the Ring Buffer in SQL 2008 R2 and found some information, but I am not entirely sure how to figure it out.

Running the query

SELECT  CAST(record AS XML)
FROM    sys.dm_os_ring_buffers
WHERE   ring_buffer_type = 'RING_BUFFER_CONNECTIVITY'

Gives me some results, on of which is interesting

<Record id="4" type="RING_BUFFER_CONNECTIVITY" time="461419385">
  <ConnectivityTraceRecord>
    <RecordType>LoginTimers</RecordType>
    <Spid>0</Spid>
    <SniConnectionId>40A403B2-B860-4877-A1D3-1FA7024356B7</SniConnectionId>
    <SniConsumerError>17830</SniConsumerError>
    <SniProvider>4</SniProvider>
    <State>11</State>
    <RemoteHost>&lt;local machine&gt;</RemoteHost>
    <RemotePort>0</RemotePort>
    <LocalHost />
    <LocalPort>0</LocalPort>
    <RecordTime>5/19/2012 16:29:23.831</RecordTime>
    <TdsBuffersInformation>
      <TdsInputBufferError>109</TdsInputBufferError>
      <TdsOutputBufferError>0</TdsOutputBufferError>
      <TdsInputBufferBytes>0</TdsInputBufferBytes>
    </TdsBuffersInformation>
    <LoginTimers>
      <TotalLoginTimeInMilliseconds>18010</TotalLoginTimeInMilliseconds>
      <LoginTaskEnqueuedInMilliseconds>0</LoginTaskEnqueuedInMilliseconds>
      <NetworkWritesInMilliseconds>0</NetworkWritesInMilliseconds>
      <NetworkReadsInMilliseconds>18010</NetworkReadsInMilliseconds>
      <SslProcessingInMilliseconds>0</SslProcessingInMilliseconds>
      <SspiProcessingInMilliseconds>0</SspiProcessingInMilliseconds>
      <LoginTriggerAndResourceGovernorProcessingInMilliseconds>0</LoginTriggerAndResourceGovernorProcessingInMilliseconds>
    </LoginTimers>
  </ConnectivityTraceRecord>
  <Stack>...</Stack>
</Record>

So, my question is, where do I find the meaning for the TDS error numbers. In this case <TdsInputBufferError>109</TdsInputBufferError>

How to optimize this SQL query?

The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:

  1. Description of the steps you can take to speed up the query.
  2. The optimal indexes for this query, which you can copy and create in your database.
  3. An automatically re-written query you can copy and execute in your database.
The optimization process and recommendations:
  1. Create Optimal Indexes (modified query below): The recommended indexes are an integral part of this optimization effort and should be created before testing the execution duration of the optimized query.
Optimal indexes for this query:
CREATE INDEX dm_ring_idx_ring_type ON sys.dm_os_ring_buffers (ring_buffer_type);
The optimized query:
SELECT
        CAST(sys.dm_os_ring_buffers.record AS XML) 
    FROM
        sys.dm_os_ring_buffers 
    WHERE
        sys.dm_os_ring_buffers.ring_buffer_type = 'RING_BUFFER_CONNECTIVITY'

Related Articles



* original question posted on StackOverflow here.