Tableau如何在Redshift上运行查询? (和/或为什么Redshift无法显示Tableau查询?) [英] How does Tableau run queries on Redshift? (And/or why can't Redshift display Tableau queries?)
问题描述
我正在尝试使用BI工具,当然包括Tableau.我评估的一部分包括将BI工具生成的SQL与该工具中的操作相关联.
I'm kicking tires on BI tools, including, of course, Tableau. Part of my evaluation includes correlating the SQL generated by the BI tool with my actions in the tool.
Tableau使我迷惑不解.我的数据库有20亿个东西;但是,无论我在Tableau中做什么,查询Redshift报告为已运行都是在SQL_CURxyz中获取10000",即游标操作.在下面的屏幕截图中,您可以看到游标ID发生了变化,表明正在运行新查询-但看不到原始查询.
Tableau has me mystified. My database has 2 billion things; however, no matter what I do in Tableau, the query Redshift reports as having been run is "Fetch 10000 in SQL_CURxyz", i.e. a cursor operation. In the screenshot below, you can see the cursor ids change, indicating new queries are being run -- but you don't see the original queries.
这是Redshift还是Tableau的怪癖?知道如何查看引擎盖下的实际运行情况吗?为什么Tableau总是一次同时处理10000条记录?
Is this a Redshift or Tableau quirk? Any idea how to see what's actually running under the hood? And why is Tableau always operating on 10000 records at a time?
推荐答案
我只是遇到了同样的问题,并编写了这个简单的查询来获取当前活动游标的所有查询:
I just ran into the same problem and wrote this simple query to get all queries for currently active cursors:
SELECT
usr.usename AS username
, min(cur.starttime) AS start_time
, DATEDIFF(second, min(cur.starttime), getdate()) AS run_time
, min(cur.row_count) AS row_count
, min(cur.fetched_rows) AS fetched_rows
, listagg(util_text.text)
WITHIN GROUP (ORDER BY sequence) AS query
FROM STV_ACTIVE_CURSORS cur
JOIN stl_utilitytext util_text
ON cur.pid = util_text.pid AND cur.xid = util_text.xid
JOIN pg_user usr
ON usr.usesysid = cur.userid
GROUP BY usr.usename, util_text.xid;
这篇关于Tableau如何在Redshift上运行查询? (和/或为什么Redshift无法显示Tableau查询?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!