Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Resolved
-
2.0.0.0-incubating
-
None
Description
When entry database is involved in query with joins, it may hang due to deadlock while accessing catalog.
DROP TABLE IF EXISTS t; CREATE TABLE t (key INT, value INT) DISTRIBUTED RANDOMLY; INSERT INTO t VALUES (1, 0); CREATE OR REPLACE FUNCTION f() RETURNS VOID AS $$ sql = """ALTER TABLE t SET DISTRIBUTED BY (key)""" plpy.execute(sql) sql = """INSERT INTO t SELECT t2.key, t2.value FROM (SELECT key, value FROM t WHERE value = 0) AS t1, (SELECT generate_series(1, 2)::INT AS key, 0::INT AS value ) AS t2 WHERE t1.value = t2.value """ # plan = plpy.prepare(sql) plpy.execute(sql) $$ LANGUAGE plpythonu VOLATILE; -- Call of function f() hangs here SELECT f();