Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qn0B3-009gE9-4H for pgsql-hackers@arkaria.postgresql.org; Sun, 01 Oct 2023 17:24:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qn0B1-00DsRY-No for pgsql-hackers@arkaria.postgresql.org; Sun, 01 Oct 2023 17:24:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qn0B1-00DsR9-DI for pgsql-hackers@lists.postgresql.org; Sun, 01 Oct 2023 17:24:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qn0Au-007dqp-U7 for pgsql-hackers@postgresql.org; Sun, 01 Oct 2023 17:24:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 391HO1n11842218; Sun, 1 Oct 2023 13:24:01 -0400 From: Tom Lane To: =?koi8-r?B?5dLPyMnOIOTFzsnTIPfMwcTJzcnSz9fJ3g==?= cc: pgsql-hackers@postgresql.org Subject: Re: Fix receiving large legal tsvector from binary format In-reply-to: <009801d9f2d9$f29730c0$d7c59240$@datagile.ru> References: <009801d9f2d9$f29730c0$d7c59240$@datagile.ru> Comments: In-reply-to =?koi8-r?B?5dLPyMnOIOTFzsnTIPfMwcTJzcnSz9fJ3g==?= message dated "Fri, 29 Sep 2023 13:36:27 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1842216.1696181041.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 01 Oct 2023 13:24:01 -0400 Message-ID: <1842217.1696181041@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?koi8-r?B?5dLPyMnOIOTFzsnTIPfMwcTJzcnSz9fJ3g=3D=3D?=3D writes: > There is a problem on receiving large tsvector from binary format with > getting error "invalid tsvector: maximum total lexeme length exceeded". Good catch! Even without an actual failure, we'd be wasting space on-disk anytime we stored a tsvector received through binary input. I pushed your 0001 and 0002, but I don't really agree that 0003 is an improvement. It looks to me like it'll result in one repalloc per lexeme, instead of the O(log N) behavior we had before. It's not that important to keep the palloc chunk size small here, given that we don't allow tsvectors to get anywhere near 1Gb anyway. regards, tom lane