[HACKERS] Useless code in ExecInitModifyTable

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема [HACKERS] Useless code in ExecInitModifyTable
Дата
Msg-id 93cf9816-2f7d-0f67-8ed2-4a4e497a6ab8@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] Useless code in ExecInitModifyTable  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
Commit d3cc37f1d801a6b5cad9bf179274a8d767f1ee50 added this to 
ExecInitModifyTable:

+   /* The root table RT index is at the head of the partitioned_rels 
list */
+   if (node->partitioned_rels)
+   {
+       Index   root_rti;
+       Oid     root_oid;
+
+       root_rti = linitial_int(node->partitioned_rels);
+       root_oid = getrelid(root_rti, estate->es_range_table);
+       rel = heap_open(root_oid, NoLock);  /* locked by InitPlan */
+   }

but I noticed that that function doesn't use the relation descriptor at 
all.  Since partitioned_rels is given in case of an UPDATE/DELETE on a 
partitioned table, the relation is opened in that case, but the relation 
descriptor isn't referenced at all in initializing WITH CHECK OPTION 
constraints and/or RETURNING projections.  (The mtstate->resultRelinfo 
array is referenced in those initialization, instead.)  So, I'd like to 
propose to remove this from that function.  Attached is a patch for that.

Best regards,
Etsuro Fujita

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: jasrajd
Дата:
Сообщение: Re: [HACKERS] An attempt to reduce WALWriteLock contention
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] ASOF join