pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: bossartn@amazon.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: michael@paquier.xyz
Cc: sulamul@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: inefficient loop in StandbyReleaseLockList()
Date: Thu, 04 Nov 2021 20:21:56 -0400
Message-ID: <364794.1636071716@sss.pgh.pa.us> (raw)
In-Reply-To: <20211104221248.pgo4h6wvnjl6uvkb@alap3.anarazel.de>
References: <1138901.1635782315@sss.pgh.pa.us>
	<C84534A6-2E66-47FF-B193-EBB566544D49@amazon.com>
	<1311319.1635804078@sss.pgh.pa.us>
	<20211102.114313.713245704579079227.horikyota.ntt@gmail.com>
	<1376384.1635862908@sss.pgh.pa.us>
	<1512317.1635867355@sss.pgh.pa.us>
	<20211104221248.pgo4h6wvnjl6uvkb@alap3.anarazel.de>

Andres Freund <andres@anarazel.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





view thread (41+ messages)  latest in thread

Message-ID: <364794.1636071716@sss.pgh.pa.us>
Permalink:  ../364794.1636071716@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/364794.1636071716@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, horikyota.ntt@gmail.com, michael@paquier.xyz, sulamul@gmail.com
  Subject: Re: inefficient loop in StandbyReleaseLockList()
  In-Reply-To: <364794.1636071716@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox