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 1gP9pE-0003Ho-T7 for pgsql-performance@arkaria.postgresql.org; Tue, 20 Nov 2018 17:28:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gP9pC-000841-Uf for pgsql-performance@arkaria.postgresql.org; Tue, 20 Nov 2018 17:28:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP9pC-00083t-N4 for pgsql-performance@lists.postgresql.org; Tue, 20 Nov 2018 17:28:34 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gP9p9-00087T-CL for pgsql-performance@postgresql.org; Tue, 20 Nov 2018 17:28:34 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 18F325F79C; Tue, 20 Nov 2018 12:28:30 -0500 (EST) Date: Tue, 20 Nov 2018 12:28:30 -0500 From: Stephen Frost To: Merlin Moncure Cc: f.pardi@portavita.eu, postgres performance list Subject: Re: PostgreSQL VS MongoDB: a use case comparison Message-ID: <20181120172829.GF3415@tamriel.snowman.net> References: <20181119172609.GR3415@tamriel.snowman.net> <20181120164325.GE3415@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VuBTcNUPe5zwk2q6" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --VuBTcNUPe5zwk2q6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Merlin Moncure (mmoncure@gmail.com) wrote: > On Tue, Nov 20, 2018 at 10:43 AM Stephen Frost wrote: > > * Merlin Moncure (mmoncure@gmail.com) wrote: > > > On Mon, Nov 19, 2018 at 11:26 AM Stephen Frost w= rote: > > > > Looks like a lot of the difference being seen and the comments made > > > > about one being faster than the other are because one system is > > > > compressing *everything*, while PG (quite intentionally...) only > > > > compresses the data sometimes- once it hits the TOAST limit. That > > > > likely also contributes to why you're seeing the on-disk size > > > > differences that you are. > > > > > > Hm. It may be intentional, but is it ideal? Employing datum > > > compression in the 1kb-8kb range with a faster but less compressing > > > algorithm could give benefits. > > > > Well, pglz is actually pretty fast and not as good at compression as > > other things. I could certainly see an argument for allowing a column > > to always be (or at least attempted to be) compressed. > > > > There's been a lot of discussion around supporting alternative > > compression algorithms but making that happen is a pretty big task. >=20 > Yeah; pglz is closer to zlib. There's much faster stuff out > there...Andres summed it up pretty well; > https://www.postgresql.org/message-id/20130605150144.GD28067%40alap2.anar= azel.de >=20 > There are also some interesting discussions on jsonb specific > discussion approaches. Oh yes, having a dictionary would be a great start to reducing the size of the jsonb data, though it could then become a contention point if there's a lot of new values being inserted and such. Naturally there would also be a cost to pulling that data back out as well but likely it would be well worth the benefit of not having to store the field names repeatedly. Then again, taken far enough, what you end up with are tables... :) Thanks! Stephen --VuBTcNUPe5zwk2q6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJb9EQ9AAoJEO1sijiDR2RVtucP/2t2Wm2QcrIUR6Rq2+62zaBL mkuEEON9pwLb+h3eH6Kg+kKDjPV8+Pp/Pc0j7GVSP7oWvod16RhPuLpWF0x8pLpf MAhulmeenWyzLyBssdH5Boo3V6TTGfehgFb+ttuPib8iCbw6mqTSchHo1xEyTp/n 1orqmSPspIi3H+9oa0xUH5E2wWvfU1XR0gHeVBl59cWVq19xxoQupHSkG6qJowkU A04TirZDrtGWEetCu7/HokG/05lOHffDTCQWe3lHGd5HuHiNrDrXkrEgZtEVruRB bbxaeGcSGM3gBvf32oKxGTmD6Ic72wMYyZPdbTMUUW6n3m44Jugs8s0OAPHeOqKC RCf0IkXppyRqcqpZDb3vArW5XD3lJNG+POaBsFQ84icXXKRgcS17Z+uy4tbZgbeb QKISQ0PbAtnsN+m3dFqWA1sORaixpf5DqsfVMBWGfF2fXo8nBbN40A+H7PQruOXQ a/QejFsKHlaohbCDVcnrkMvK0G5mGsNH3EqfRjFlwnIZl2Y6EBfsdtnRtHPA7h2B +2aZlA0u84DeFEeQcaojMMsYFbCT/Xyw7Dx6tYneRdgAo2KR3qvroEDdSfgvVdtI 8xjVPCMzbVHoHLxyXlL2MRObt1WgaXe4C22TKWnzBz+hnwj7ESTogBcRgd/5YVC9 2YjuR/Uu+U1ue8DKZVfH =WhoS -----END PGP SIGNATURE----- --VuBTcNUPe5zwk2q6--