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 1lqggA-0007Do-QA for pgsql-general@arkaria.postgresql.org; Tue, 08 Jun 2021 18:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqgg9-0004K5-Qp for pgsql-general@arkaria.postgresql.org; Tue, 08 Jun 2021 18:42:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqgg9-0004Jx-ID for pgsql-general@lists.postgresql.org; Tue, 08 Jun 2021 18:42:21 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqgg1-0006Sn-R0 for pgsql-general@lists.postgresql.org; Tue, 08 Jun 2021 18:42:21 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 1A93D4D88; Tue, 8 Jun 2021 20:42:12 +0200 (CEST) Date: Tue, 8 Jun 2021 20:42:12 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: index unique Message-ID: <20210608184212.GA9580@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <20210607065501.GA17125@hjp.at> <20210607220848.GB17125@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0F1p//8PRICkK4MW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-06-08 18:30:16 +0200, Marc Millas wrote: > the only pb observed is the size of the object accepted. if the geom is a= bit > "big" then the index errors.about btree=A0size of index object. > but if I create a table test_l with a text column blabla as a PK, and ins= ert a > 100 000 character long string , no pb. > if I do an explain analyze select blabla from test_l order by blabla, pos= tgres > tells me that it did an index only scan. > so, I wonder why Postgres is able to put a 100 000 long text in a btree i= ndex > and NOT a geom column which wkt is 10 000 bytes long. Good question. Maybe your texts compresses better than your geometries: hjp=3D> insert into t(t) values(repeat('a', 235327) || '1'); INSERT 0 1 Time: 60.057 ms hjp=3D> insert into t(t) values(repeat('a', 235328) || '1'); ERROR: index row size 2720 exceeds maximum 2712 for index "t_pkey1" HINT: Values larger than 1/3 of a buffer page cannot be indexed. Consider a function index of an MD5 hash of the value, or use full text ind= exing. Time: 58.751 ms Note the difference between the length of the string I was trying to insert and the length of the row it complains about. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --0F1p//8PRICkK4MW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmC/uf8ACgkQ8g5IURL+ KF3H6Q//dl4Owm49iBowieZfHgi6l2iMY5+2X4W0uCotZp4xCVyemyL5E/3jT7tj NhYdZzPH7Od/gYRhNrD/dM1nNU0B+LdLjkq2HPN9bMXi1oeA3N52DLMHGItmoECv pN7ni2BskEF7TxsoIjeZYJgPdg4MdsdXJYmlNLRszxURPu8iXdZLhGLXDfod+LX1 NtIFc7Zr+mAMwbCdkKctV/iVK67fQlr6VrpiBlSW69rrotYYBc+3aZ4SBIkI6fxX 47hxQrAZ+OfnW7dZAH4cSN4EhF18m38o7UhssAL3A6ivmcLIpMhT6gV+4/DdJpPA DFpn2Byc/t8OoZ/NaSHbEyGTBUOKTkhpBAUOIXb+ZNBraPESjzeEcVFs6KtT500g ZDyks2T/j9AvFN76BIoOLam3i3EjncUl5ZG8nOJ4DHm9l7iOclXTC8ABa15YNqcf mVQMTcsIMmt9weTYWwA6xTNXLNkgZQjY8WcxwNdBlW4N5IASUI0ABtyUhERLEVVn erV3Ul96L1jBdFyWc8q2BWUi39aULEIMAvudaW5sWFeCr2WCEA8zPT8+7H7yAg2Y 0C/tGo06qIU2UYVyj+oqC/coQjgg4ayeESBOXqpNDuq3IOjcDovoP+6E1Rj4NITG 0CIHRfrtbR8PHlq1t9eogJW/3gXYAXBpByen9ODVeuSqC05KldY= =4bxP -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--