Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzMMI-00045M-7b for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jun 2022 17:54:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nzMMG-0000xS-Ts for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jun 2022 17:54:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzMMG-0000xJ-Gt for pgsql-hackers@lists.postgresql.org; Thu, 09 Jun 2022 17:54:12 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nzMMB-0001XC-J1 for pgsql-hackers@postgresql.org; Thu, 09 Jun 2022 17:54:11 +0000 Received: by mail-pl1-x62a.google.com with SMTP id q18so20804609pln.12 for ; Thu, 09 Jun 2022 10:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ardentperf-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=lXNMhhgmBPUEQvg9x7iL9Si3IY7+WO/NQUoXf7s7p0c=; b=h03OJesqcZD7c8bKhuTFV7/6yLTO2Zmcwl48gFUvy7ZHvsbEDSuerS/0Oyynl4JajV 1C3mM/UQ3GRQ92fujKVCzSJoDK+fpC8TgkR49DMY41PxF9mUqWkK6sfcqVkzt83YHBRy D5fIACNF7IDgsolCjOx4Vm6Y7PaLgSHOhJ2TGa6pJ/okiIqc04c/OuDzGJDnZa6FswRv l1MUEQ5qGUXQvH50bTQ8G5clHKhjcwW6UGeo2OQp/dk0sbV5zIjL9XWg/YvyKmAfWQAy uF4TdWmkRdqlxQhU8l7zpq3uc6sUYQObYDCnfLwzj/2n/jPfNg+bLErc0vHgK+5eBxAH gqPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=lXNMhhgmBPUEQvg9x7iL9Si3IY7+WO/NQUoXf7s7p0c=; b=5ytIuR3DxRswv+89Rs6cFOwTd8+hCsCbpDjylBtTDa0AkLldNJBlNxoYWGjPiETjQw 4u2sDpTph611rtxeyYGBBqPNVSPTj1/OUrUqX4ZJu0fLW6JrRXviaIJ6HXrXjJYPZedU umxOYi0kYLMzPQFlu9uEz4EgZDxaH4nFsAirEzbe4yG/g5QuRQK30GV49Sv/HgagGaI+ sXz3FKjzp+6uAcGXFflqX9LUBBpSZFTVdtrnspN1FAYse9Cx2B+SuZVS4mFcf79Bl39r byiHyzPgusgHWbuhbsUHeyLQs4ArjS3VfcV6BG69C+0Gq1clKVac1d7CAH8CnvldrSez TrXA== X-Gm-Message-State: AOAM531yFpmDw/nJ66g/oS6ujS2rmfuVJoDbYrFHiOq4OM0KZs62Ele2 cgWMWS+NVxj37oXvLNMMSQZbXA== X-Google-Smtp-Source: ABdhPJzBZezbxvipaAVg9NDTlxCPADk01DqqRVdVh21uJF+Qg4hu0MOlX528Xr0ePOoiQloXSw09Xw== X-Received: by 2002:a17:902:e5cb:b0:166:3622:a7e4 with SMTP id u11-20020a170902e5cb00b001663622a7e4mr6995125plf.32.1654797246456; Thu, 09 Jun 2022 10:54:06 -0700 (PDT) Received: from smtpclient.apple (c-24-17-46-25.hsd1.wa.comcast.net. [24.17.46.25]) by smtp.gmail.com with ESMTPSA id s5-20020a656445000000b003fcfdc9946dsm15076611pgv.51.2022.06.09.10.54.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jun 2022 10:54:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Jeremy Schneider Mime-Version: 1.0 (1.0) Subject: Re: Collation version tracking for macOS Date: Thu, 9 Jun 2022 10:54:01 -0700 Message-Id: References: Cc: Thomas Munro , Jim Nasby , Tom Lane , Peter Eisentraut , pgsql-hackers In-Reply-To: To: Peter Geoghegan X-Mailer: iPhone Mail (19F77) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 8, 2022, at 22:40, Peter Geoghegan wrote: >=20 > =EF=BB=BFOn Wed, Jun 8, 2022 at 10:24 PM Jeremy Schneider > wrote: >> Even if PG supports two versions of ICU, how does someone actually go abo= ut removing every dependency on the old version and replacing it with the ne= w? >=20 > They simply REINDEX, without changing anything. The details are still > fuzzy, but at least that's what I was thinking of. >=20 >> Can it be done without downtime? Can it be done without modifying a runni= ng application? >=20 > Clearly the only way that we can ever transition to a new "physical > collation" is by reindexing using a newer ICU version. And clearly > there is going to be a need to fully deprecate any legacy version of > ICU on a long enough timeline. There is just no getting around that. I=E2=80=99m probably just going to end up rehashing the old threads I haven=E2= =80=99t read yet=E2=80=A6 One challenge with this approach is you have things like sort-merge joins th= at require the same collation across multiple objects. So I think you=E2=80=99= d need to keep all the old indexes around until you have new indexes availab= le for all objects in a database, and somehow the planner would need to be s= mart enough to dynamically figure out old vs new versions on a query-by-quer= y basis. May need an atomic database-wide cutover; running a DB with interna= lly mixed collation versions doesn=E2=80=99t seem like a small challenge. It= would require enough disk space for two copies of all indexes, and queries w= ould change which indexes they use in a way that wouldn=E2=80=99t be immedia= tely obvious to users or app dev. Suddenly switching to or from a differentl= y-bloated index could result in confusing and sudden performance changes. Also there would still need to be a plan to address all the other non-index o= bjects where collation is used, as has been mentioned before. And given the current architecture, that final =E2=80=9Calter database updat= e default collation=E2=80=9D command still seems awful risky, bug-prone and d= ifficult to get correct. At least it seems that way to me. At a minimum, this is a very big project and it seems to me like it may be w= ise to get more end-to-end fleshing out of the plans before committing incre= mental pieces in core (which could end up being misguided if the plan doesn=E2= =80=99t work as well as assumed). Definitely doesn=E2=80=99t seem to me like= anything that will happen in a year or two. And my opinion is that the problems caused by depending on OS libraries for c= ollation need to be addressed on a shorter timeline than what=E2=80=99s real= istic for inventing a new way for a relational database to offer transparent= or online upgrades of linguistic collation versions. Also I still think folks are overcomplicating this by focusing on linguistic= collation as the solution. Like 1% of users actually need or care about hav= ing the latest technically correct local-language-based sorting, at a databa= se level. MySQL did the right thing here by doing what every other RDBMS did= , and just making a simple =E2=80=9Cgood-enough=E2=80=9D collation hardcoded= in the DB, same across all platforms, that never changes. The 1% of users who need true linguistic collation can probably deal with th= e trade-off of dump-and-load upgrades for their ICU indexes and databases fo= r a few more years. -Jeremy Sent from my TI-83