Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnDoi-0006oB-7H for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jul 2019 03:07:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hnDog-00033r-Q2 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jul 2019 03:07:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnDog-00033f-EP for pgsql-hackers@lists.postgresql.org; Tue, 16 Jul 2019 03:07:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hnDod-0001xB-Dc for pgsql-hackers@lists.postgresql.org; Tue, 16 Jul 2019 03:07:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x6G37caU002421; Mon, 15 Jul 2019 23:07:38 -0400 From: Tom Lane To: David Rowley cc: Jesper Pedersen , Andres Freund , Robert Haas , PostgreSQL Hackers Subject: Re: POC: converting Lists into arrays In-reply-to: References: <481.1551390571@sss.pgh.pa.us> <24783.1551568303@sss.pgh.pa.us> <20190303043424.itzy3ge52xrkpmpr@alap3.anarazel.de> <437.1551637744@sss.pgh.pa.us> <12684.1551723095@sss.pgh.pa.us> <20190304190612.vgqqsowzkrh22623@alap3.anarazel.de> <26464.1551734920@sss.pgh.pa.us> <20190304221101.hdg4vj5fo4eewh3b@alap3.anarazel.de> <20190304235402.nod3gbotk2qtd4nh@alap3.anarazel.de> <1131.1551746172@sss.pgh.pa.us> <14626.1558745627@sss.pgh.pa.us> <29297.1558799327@sss.pgh.pa.us> <25178.1562006685@sss.pgh.pa.us> <25258.1562023641@sss.pgh.pa.us> <2305.1562181615@sss.pgh.pa.us> <29361.1563220190@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Tue, 16 Jul 2019 14:56:46 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2419.1563246458.1@sss.pgh.pa.us> Date: Mon, 15 Jul 2019 23:07:38 -0400 Message-ID: <2420.1563246458@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > The only thoughts I have so far here are that it's a shame that the > function got called list_qsort() and not just list_sort(). I don't > see why callers need to know anything about the sort algorithm that's > being used. Meh. list_qsort() is quicksort only to the extent that qsort() is quicksort, which in our current implementation is a bit of a lie already --- and, I believe, it's much more of a lie in some versions of libc. I don't really think of either name as promising anything about the underlying sort algorithm. What they do share is an API based on a callback comparison function, and if you are looking for uses of those, it's a lot easier to grep for "qsort" than some more-generic term. regards, tom lane