You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@madlib.apache.org by GitBox <gi...@apache.org> on 2021/11/10 21:59:10 UTC

[GitHub] [madlib] orhankislal commented on a change in pull request #573: @orhankislal WCC: Optimize subtx count and catalog entry frequency

orhankislal commented on a change in pull request #573:
URL: https://github.com/apache/madlib/pull/573#discussion_r747018405



##########
File path: src/ports/postgres/modules/graph/wcc.py_in
##########
@@ -299,24 +315,27 @@ def wcc(schema_madlib, vertex_table, vertex_id, edge_table, edge_args,
     rename_table(schema_madlib, newupdate, out_table)
     # Create summary table. We only need the vertex_id and grouping columns
     # in it.
-    plpy.execute("""
-            CREATE TABLE {out_table_summary} (
-                {grouping_cols_summary}
-                vertex_table    TEXT,
-                vertex_id   TEXT,
-                vertex_id_type  TEXT
-            )
-        """.format(grouping_cols_summary='' if not grouping_cols else
-                   'grouping_cols TEXT, ', **locals()))
     vertex_id_type = get_expr_type(vertex_id, vertex_table)
     plpy.execute("""
-            INSERT INTO {out_table_summary} VALUES
-            ({grouping_cols_summary} '{vertex_table}', '{vertex_id}',
-            '{vertex_id_type}')
-        """.format(grouping_cols_summary='' if not grouping_cols else
-                   "'{0}', ".format(grouping_cols), **locals()))
-    plpy.execute("DROP TABLE IF EXISTS {0},{1},{2},{3} ".
-                 format(message, oldupdate, newupdate, toupdate))
+        CREATE TABLE {out_table_summary} (
+            {grouping_cols_summary}
+            vertex_table    TEXT,
+            vertex_id   TEXT,
+            vertex_id_type  TEXT
+        );
+    """.format(grouping_cols_summary='' if not grouping_cols else
+                    'grouping_cols TEXT, ',
+               **locals()))
+
+    plpy.execute("""
+        INSERT INTO {out_table_summary} VALUES
+        ({grouping_cols_txt} '{vertex_table}', '{vertex_id}',
+        '{vertex_id_type}');
+
+        DROP TABLE IF EXISTS {message},{oldupdate},{newupdate},{toupdate};
+    """.format(grouping_cols_txt='' if not grouping_cols else
+                    "'{0}', ".format(grouping_cols),
+               **locals()))

Review comment:
       The common problem is, on GPDB 5X, we cannot create and use a table in the same block. That is why I had to shop up a number of blocks in the prep stage. I can combine them into a single `create table ... as ...` block.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@madlib.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org