Merge pull request #230 from CartoDB/add_index_augment_table_tmp

Add index to temporary table in AugmentTable
This commit is contained in:
Carla 2016-07-26 17:04:09 +02:00 committed by GitHub
commit e3b053d4cd

View File

@ -126,6 +126,11 @@ RETURNS boolean AS $$
.format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name)) .format(username=plpy.quote_nullable(username), orgname=plpy.quote_nullable(orgname), server_schema=plpy.quote_literal(server_schema), server_table_name=plpy.quote_literal(server_table_name), fdw_server=plpy.quote_literal(server_name))
) )
# Add index to cartodb_id
plpy.execute('CREATE UNIQUE INDEX {temp_table_name}_pkey ON "{user_schema}".{temp_table_name} (cartodb_id)'
.format(user_schema=user_schema, temp_table_name=temporary_table_name)
)
# Prepare table to receive augmented results in new columns # Prepare table to receive augmented results in new columns
for idx, column in enumerate(colnames_arr): for idx, column in enumerate(colnames_arr):
if colnames_arr[idx] is not 'the_geom': if colnames_arr[idx] is not 'the_geom':