简体   繁体   English

合并数据时postgres-xl自联接成本为10秒

[英]postgres-xl self join cost 10 seconds when combine data

My postgres-xl version was 9.5r1.5 stable. 我的postgres-xl版本是9.5r1.5稳定。 When query like below 当查询如下

SELECT * FROM tests t1 LEFT JOIN tests t2 ON t1.id1 = t2.id2 WHERE t1.id1=10000;

This query is simple, and just return one row. 这个查询很简单,只返回一行。 When I ran it in the data node, only cost 10ms. 当我在数据节点中运行它时,只花费10毫秒。 But cost 10020 ms in the coord node. 但是在coord节点中花费10020毫秒。 I had tried some other query, and make sure that, when join the same table coord node cost 10 seconds. 我曾尝试过其他一些查询,并确保在加入同一个表coord节点时花费10秒。 But if the query return nothing, it only cost 20ms in the coord node. 但是如果查询没有返回任何内容,则在coord节点中仅花费20ms。 So i think, it something wrong when coord node combine the data. 所以我认为,当coord节点组合数据时,它出了问题。 can anyone tell me how to avoid this. 任何人都可以告诉我如何避免这种情况。 thanks very much. 非常感谢。

Also try something like "SET work_mem = '256MB'; SET LOCAL work_mem = '256MB';". 也尝试类似“SET work_mem ='256MB'; SET LOCAL work_mem ='256MB';”。 Increase default memory for sorting and vacuum. 增加排序和真空的默认内存。

This is more a question for https://dba.stackexchange.com and, in fact, someone had the same problem there . 对于https://dba.stackexchange.com来说这更是一个问题,事实上, 有人在那里遇到了同样的问题

You can see my answer on the linked question, here is a short summary: 你可以在链接的问题上看到我的答案 ,这是一个简短的总结:

It's a postgres-xl bug that is triggered on queries planned and executed using rows redistribution and for which some nodes don't have any rows. 这是一个postgres-xl错误,它是在使用行重新分配计划和执行的查询上触发的,并且某些节点没有任何行。

You can work around it by changing the query, chaning the tables distribution, or adding data. 您可以通过更改查询,查找表分发或添加数据来解决此问题。 You can use EXPLAIN to check if your query will involve data redistribution. 您可以使用EXPLAIN来检查您的查询是否涉及数据重新分发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM