Tableau wraps custom SQL queries inside another query. Sometimes Tableau does some funny stuff with these queries - especially if you are using sets.
You can see exactly what it is doing by monitoring the queries coming into Oracle.
I use something like this:
SELECT sess.sid, sess.process, sess.status, sess.schemaname, sql.sql_fulltext
FROM v$session sess, v$sql sql
WHERE sql.sql_id = sess.sql_id
Hope this helps!
Also, using Custom SQL should normally be your last resort, particularly with native db connections such as an Oracle connection. Tableau will write the SQL queries efficiently as it needs them when using the preferred drag-n-dropping of tables/views method.
2 of 2 people found this helpful
Historically Toad only fetches 500 rows by default. Unsure if the behavior has changed, but KB note still exists. How to fetch more than 500 rows at a time in the data grid (56573)
Ignoring the network bandwidth for a moment, try running this from Toad to see how long Oracle takes to determine the whole resultset:
select count(*) from (<your-query-goes-here>);
The FIRST_ROWS Oracle optimizer hint tells Oracle to return matching rows as they are found, so Toad could get it's 500 rows back quickly even though the query is still running to determine the remaining rows. I do like Derrick's suggestion too though...
On top of that, Tableau's query will look like SELECT Col1, Col2 ... FROM (<your-custom-sql-goes-here) so if you are running with Toad - do it in this format.
+1 on not fetching all the rows in most DB tools.
p.s. To clarify - do Tableau Desktop and Tableau Server have same performance?