Re: inefficient loop in StandbyReleaseLockList()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: bossartn(at)amazon(dot)com, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, michael(at)paquier(dot)xyz, sulamul(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: inefficient loop in StandbyReleaseLockList()
Date: 2021-11-05 00:21:56
Message-ID: 364794.1636071716@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> I wonder if it's worth adding a note to list_delete_first() mentioning its
> O(N) behaviour. It's not immediately visible from the code, and from the list
> name one could very well be excused to not be worried about O(N) costs.

Hm. I think it's not the only list function with O(N) behavior;
in fact there used to be more such functions than there are now.
But I could get behind a patch that annotates all of them.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-11-05 01:09:59 Re: [sqlsmith] Failed assertion in brin_minmax_multi_distance_float4 on REL_14_STABLE
Previous Message Tom Lane 2021-11-05 00:13:50 Re: pgsql: Fix WAL replay in presence of an incomplete record