Tableau Online Tip of the Week: Resolving Reoccurring Redshift Cursor Limit Errors

Version 1

    To improve the reliability of refresh tasks on large Amazon Redshift data sources, Tableau Server and Tableau Online retrieve data using Redshift server-side cursors. These cursors enable data-fetch operations using multiple smaller requests rather than a single large request. However, if numerous requests for data occur simultaneously, you might run into a limit that Redshift places on the number of cursors that can be in use concurrently.


    To increase the number of concurrent cursors directly on the Amazon Redshift database, refer to the following Amazon documentation:


    Database Developer Guide:

    http://docs.aws.amazon.com/redshift/latest/dg/declare.html


    You can also configure the number of Redshift server-side cursors on a per-data-source or per-workbook basis by adding a TDC file in the appropriate Tableau repository folder for Tableau Desktop and then publishing the data source or workbook to Tableau Online. Instructions are below.

     

    Step 1

    The first step is to copy the following and save it to a file named ConfigureRedshiftCursors.tdc.

     

     

    <connection-customization class='redshift' version='9.0' enabled='true'>

     

     

      <vendor name='redshift' />

     

     

      <driver name='redshift' />

     

     

      <customizations>

     

     

        <customization name='odbc-connect-string-extras' value='UseDeclareFetch=0' />

     

     

      </customizations>

     

     

    </connection-customization>

     

     

    The UseDeclareFetch=0 value is what configures the number of supported server-side cursors. When the value is 0, server-side cursors are disabled. To set the number of cursors to, for example, 6, edit the file to use that as the value: UseDeclareFetch=6. No other part of the file needs to be changed.

     

     

    Step 2

    After editing and saving the TDC file, copy it to the My Tableau Repository\Datasources folder (for data sources) or the My Tableau Repository\Workbooks folder (for workbooks). Then publish the data source or workbook. The instructions in the TDC file will automatically be included in the data source or workbook.

     

    Additional information can be found on the following KB article:

     

    Working with Amazon Redshift Server-Side Cursors

    http://kb.tableau.com/articles/knowledgebase/redshift-concurrent-cursor-limit