KNOWLEDGE BASE

Connecting Through Custom SQL Causes Slow Performance


Published: 04 Feb 2013
Last Modified Date: 20 Jul 2023

Issue

Using custom SQL to connect to a data source causes slow performance in Tableau Desktop.

Environment

Tableau Desktop

Resolution

A best practice recommendation is to use the custom SQL statement to create a materialized view in the database, and then connect Tableau to that database view. This method streamlines the query and improves performance.  When the database provides the query power, Tableau can focus on filtering and rendering the data provided by the database.
 

Cause

Custom SQL in the data connection can impact performance because Tableau issues the query to the database inside of a subquery. 
 

Additional Information

Because Custom SQL is sent to the database within a subquery, sometimes the same query can perform more quickly in the database's native query tool. 

Materialized View

A materialized view is a “select query” performed on the data source and the end result set is stored as a table in the database. The materialized view can be kept in sync with database updates.



Did this article resolve the issue?