是否有针对citus不支持的功能的解决方法?

时间:2016-06-03 10:57:00

标签: postgresql citus

对于查询:

SELECT
    cu.id id,
    cu.email email,
    SUM(case when(rt.type = 'credit' and ( re.type = 'account_refilling' OR re.type = 'site_publishing' OR re.type = 'tariff_buying' )) then rt.amount else 0 end ) transactions_sum
  FROM client_users cu
  JOIN referral_accounts ra ON ra.owner_id = cu.id
  LEFT JOIN referral_transactions rt ON rt.account_id = ra.id
  JOIN referral_events re ON re.id = rt.event_id
  GROUP BY cu.id, cu.email
  ORDER BY transactions_sum DESC

我收到了错误:

ERROR:  cannot perform distributed planning on this query
DETAIL:  Cartesian products are currently unsupported

我可以解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

这很奇怪,但是当我使用相同的方法分配表并为查询中的表设置相等的分片计数时,错误消失了。