RE: Use list_delete_cell instead in some places

From: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Use list_delete_cell instead in some places
Date: 2020-10-13 08:02:10
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> I found some code path use list_delete_ptr while the loop of foreach() is
> iterating.
> List_delete_ptr seems search the list again to find the target cell and
> delete it.
> > foreach(cell, list)
> > {
> > if (lfirst(cell) == datum)
> > return list_delete_cell(list, cell);
> > }
> If we already get the cell in foreach loop, I think we can use
> list_delete_cell to avoid searching the list again.
> Please see the attachment for the patch.

I have added it to commitfest.

Best regards.

Browse pgsql-hackers by date

  From Date Subject
Next Message Luc Vlaming 2020-10-13 08:57:23 allow partial union-all and improve parallel subquery costing
Previous Message Amit Kapila 2020-10-13 07:54:44 Re: Resetting spilled txn statistics in pg_stat_replication