Obsolete comment in ExecInsert()

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Obsolete comment in ExecInsert()
Date: 2022-09-28 10:25:12
Message-ID: CAPmGK14goatHPHQv2Aeu_UTKqZ+BO+P+zd3HKv5D+dyyfWKDSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While reviewing the “Fast COPY FROM based on batch insert" patch, I
noticed this comment introduced in commit b663a4136:

/*
* If a certain number of tuples have already been accumulated, or
* a tuple has come for a different relation than that for the
* accumulated tuples, perform the batch insert
*/
if (resultRelInfo->ri_NumSlots == resultRelInfo->ri_BatchSize)
{
ExecBatchInsert(mtstate, resultRelInfo,
resultRelInfo->ri_Slots,
resultRelInfo->ri_PlanSlots,
resultRelInfo->ri_NumSlots,
estate, canSetTag);
resultRelInfo->ri_NumSlots = 0;
}

I think the “or a tuple has come for a different relation than that
for the accumulated tuples" part in the comment is a leftover from an
earlier version of the patch [1]. As the code shows, we do not handle
that case anymore, so I think we should remove that part from the
comment. Attached is a patch for that.

Best regards,
Etsuro Fujita

[1] https://www.postgresql.org/message-id/TYAPR01MB2990ECD1C68EA694DD0667E4FEE90%40TYAPR01MB2990.jpnprd01.prod.outlook.com

Attachment Content-Type Size
Remove-obsolete-comment.patch application/octet-stream 702 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-09-28 10:35:16 Re: longfin and tamandua aren't too happy but I'm not sure why
Previous Message Kyotaro Horiguchi 2022-09-28 09:41:10 Re: A doubt about a newly added errdetail