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 1gNjG2-0000yu-K6 for pgsql-general@arkaria.postgresql.org; Fri, 16 Nov 2018 18:54:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNjFz-00049U-F3 for pgsql-general@arkaria.postgresql.org; Fri, 16 Nov 2018 18:54:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNjFz-00043p-2w for pgsql-general@lists.postgresql.org; Fri, 16 Nov 2018 18:54:19 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNjFw-0007nr-Bo for pgsql-general@lists.postgresql.org; Fri, 16 Nov 2018 18:54:17 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A42265F79C; Fri, 16 Nov 2018 13:54:15 -0500 (EST) Date: Fri, 16 Nov 2018 13:54:15 -0500 From: Stephen Frost To: =?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= Cc: Alvaro Herrera , "pgsql-generallists.postgresql.org" Subject: Re: WTF with hash index? Message-ID: <20181116185415.GG3415@tamriel.snowman.net> References: <20181113193723.kgki3ja6xpebo24l@alvherre.pgsql> <7E931A8C-2CDE-43EC-8777-3EEFD43EF27B@ya.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="w2JjAQZceEVGylhD" Content-Disposition: inline In-Reply-To: <7E931A8C-2CDE-43EC-8777-3EEFD43EF27B@ya.ru> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --w2JjAQZceEVGylhD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * =D0=9E=D0=BB=D0=B5=D0=B3 =D0=A1=D0=B0=D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2= (splarv@ya.ru) wrote: > Ah, thanks. I am not a developer of PostgreSQL. I am a developer in Postg= reSQL. :) And I see two hash indexes on the same data and one of them 43 ti= mes bigger then other, this looked like something terribly wrong. Just free= idea how to considerably improve your product. Ultimately, it might be less improvement overall and more of a regression though, in the common cases. This use-case isn't common for a hash index. If we changed all hash indexes to instead be gin indexes of jsonb values, we'd end up with the common hash index use-cases being much, much worse. In the end, this comes down to choosing the right index for your data and your queries, which is actually a rather difficult problem to handle in some kind of automated way as there are lots of different trade-offs to consider. Thanks! Stephen --w2JjAQZceEVGylhD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJb7xJXAAoJEO1sijiDR2RVVtEP/Au+DBREfqyS9/lO8aPqU/sF gAQs9lb5FqNHReQ9eWWg8j/rIIHBjULL/5YXrhtSp+gnsH+o0joM0MFjdpp5Kx8G lnUYSNaIyJG1cvc1sT3yLtQqr0SIK1QHK/XdnU3ZTzGgo1p3M+q+QUKFLcVXnQml W9yRuswr2a45NReiiEkyIYdyVLy5XzQ5bd/dLNZAsWFXnSAcjER/IcNwPI45PmRz OuC//9SEzvbthd2w0ZCTiiRcMruWMW5WzYt0Puuew6zlNttoxl3XcXdvXMzfj73s oJsXOSVgrGXwaH14c3F49wIWwVA4SHdBO6vZVj28UbsStq9yDFe0BhyLbu7nf4uR y5YT0z5MaE7LPHZkG7YjBsxhoL3xBF0tx72CsS1xtsX7XbM8/cNpwZEGFsokaaCx LhE1jkk86dufsi6hDbor+GpAu6yILdZQaW6b1v6bUYbMN4FGb/1SvyNFbm9hZUEi jj+66iCXr9ZxbCndo/GdInesgy9FPxd1kfJyVhstW0XECexJvixD5iGT6FcGKalW Qjr+f3y5FPdpjbMmhRQzv20+Oiii5j9XCdbsrOPLm9I2hLJcv/AaPFPc23hFl1Kb 4aXdO8nu2tR5qAYB5qe35ALCi25DmgnSHb8s1RkLGDyhsbHyfEp5gcpYNrTDIdiB A6znfHB/LYfqz4Oj212n =s5e1 -----END PGP SIGNATURE----- --w2JjAQZceEVGylhD--