Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH8u7-00081p-Ux for pgsql-performance@arkaria.postgresql.org; Mon, 29 Oct 2018 14:52:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gH8u4-0000OP-R6 for pgsql-performance@arkaria.postgresql.org; Mon, 29 Oct 2018 14:52:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH8u4-0000OI-GL for pgsql-performance@lists.postgresql.org; Mon, 29 Oct 2018 14:52:28 +0000 Received: from [82.118.24.81] (helo=kilimanjaro.scorpionshops.com) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gH8u1-0003qZ-Dw for pgsql-performance@lists.postgresql.org; Mon, 29 Oct 2018 14:52:27 +0000 Received: from [10.0.11.210] (office-se.mytaste.name [46.246.120.34]) by kilimanjaro.scorpionshops.com (Postfix) with ESMTPSA id 14CA37BC76D for ; Mon, 29 Oct 2018 15:52:23 +0100 (CET) From: Andreas Karlsson Subject: Re: Indexes on UUID - Fragmentation Issue To: "pgsql-performance@lists.postgresql.org" References: Message-ID: <2d34b6d8-a22f-e5de-1cbe-f92012006de9@proxel.se> Date: Mon, 29 Oct 2018 15:52:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 82.118.24.81 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/29/2018 02:29 PM, Uday Bhaskar V wrote:> I have > created C function which can generate a sequential UUID, but I am not > sure how best I can use that in postgres. > > I would really like to contribute to Postgres, If I can. Please let me > know your thoughts or plans regarding UUID generation. How is it implemented? I can personally see two ways of generating sequential UUID:s. Either you use something like PostgreSQL's sequences or you can implement something based on the system time plus some few random bits which means they will be mostly sequential. It could be worth checking on the hackers mailing list if there is any interest in this feature, but if it works like a sequence it should also probably be a sequence if it is ever going to be accepted into the core. For your own use I recommend doing like Merlin suggested and write an extension. As long as you know a bit of C they are easy to write. Andreas