Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ec5Vg-0000lh-Ow for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jan 2018 08:25:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ec5Vf-0001oU-NS for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jan 2018 08:25:19 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ec5Vf-0001oE-Cw for pgsql-hackers@lists.postgresql.org; Thu, 18 Jan 2018 08:25:19 +0000 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ec5Vb-0006Zn-G2 for pgsql-hackers@postgresql.org; Thu, 18 Jan 2018 08:25:18 +0000 Received: by mail-it0-x241.google.com with SMTP id w14so11951158itc.3 for ; Thu, 18 Jan 2018 00:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dFefEpHHtyJIR+giR88RucjKmBjTOX2+eGkiyolo5Os=; b=I5F4zGDL+r2yUX3T5FngNFqb6KfPMqegcRyg1AJYqIYyiM7pHcqeS4593Z+eBkFeE3 enOmK0SJce/vaobFt+SseO4Y6o0VPzqnY/EwWVrUX3/Nswsrpg53LY/eih/Rgq6043cS pRicKXn1eZnOkcfJWyTGR1sbq64ncgVM892tZ4VRTQYj08sUvIUAhgp1UApaJp/sWM6c d+IbJyLjRdAm8wheJRYTTRqCxIQGTZPf34nfY9wT8arDMy5bTOpDXyQWjnMEfPQ/mWyZ Ze967f9ELzuCRc97sBkrP0PGuvG90GVYihXLKom1RVOaJA3MuwIrtiVjJcxpnvUSI0dK b6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dFefEpHHtyJIR+giR88RucjKmBjTOX2+eGkiyolo5Os=; b=tDD0xz3Gk4GE8yrZIiBucjSkNv66KC7H2OlFfZOZXxQMaK3zV93EhhogjEyN37lEWs a/rmuPrqaLA4V7yxS4vAuKOpR1UjRrpaiMNcjncADiNirLE1k7bA7LC3mUkVQqAtbSD2 kVlYXNF9AfHXJA382musHQHNZyI+v1jxi2QScX6Psobm49I2lOugVqClTwCgxVxCM5Kb afNwVWAHtUu22jE47lgpR0Q+EvKslagYfSWiQTUb6+SSlDpVLwt8puYQWsvEdDlyKEhj 3yniWAyCf5BYVSLg3IQWHZ6i3wOip+ehJOVm/n1CEtMC2h16Ec1cXKOUfsRMXGgnJp8f QmpA== X-Gm-Message-State: AKwxytc/YJBocNfz/F4nbsPVOsKZWk+Ez00V1x5sT6DWVcxnpkMbMP8u 2oNcDCYTQin3b+t9ms6jYtc= X-Google-Smtp-Source: ACJfBosU/cPYbhyKGXs7aa7G/UzWPvtmxWSLAcwsLLVtFfq9avi1RfLjsY7E6QP6ecJGOCiLMgKlYw== X-Received: by 10.36.64.136 with SMTP id n130mr1363321ita.105.1516263912439; Thu, 18 Jan 2018 00:25:12 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id 191sm3536669itx.16.2018.01.18.00.25.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 00:25:11 -0800 (PST) Date: Thu, 18 Jan 2018 17:25:05 +0900 From: Michael Paquier To: Andrey Borodin Cc: Kyotaro HORIGUCHI , sk@zsrv.org, david@nlpgo.com, pgsql-bugs@lists.postgresql.org, pgsql-hackers@postgresql.org Subject: Re: Index-only scan returns incorrect results when using a composite GIST index with a gist_trgm_ops column. Message-ID: <20180118082505.GA84508@paquier.xyz> References: <1516210494.1798.16.camel@nlpgo.com> <412861516217175@web38o.yandex.ru> <20180118.144851.24081723.horiguchi.kyotaro@lab.ntt.co.jp> <62C2B9A0-51BC-40FF-9BCA-F203784CB9C1@yandex-team.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <62C2B9A0-51BC-40FF-9BCA-F203784CB9C1@yandex-team.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2018 at 12:57:38PM +0500, Andrey Borodin wrote: >> 18 =D1=8F=D0=BD=D0=B2. 2018 =D0=B3., =D0=B2 10:48, Kyotaro HORIGUCHI =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(= =D0=B0): >>=20 >> Gist imposes the ninth strategy to perform index only scan but >> planner is not considering that >> .... >> Please find the attached patch. > I agree with you that current behavior is a bug and your patch seems corr= ect. > I'm a bit worried about ninth strategy words: fetch is not necessary >> now, if opclass lacks compress methods - index only scan is >> possible. See >> https://github.com/postgres/postgres/commit/d3a4f89d8a3e500bd7c0b7a8a8a5= ce1b47859128 >> for details. > > Though there are tests in cube and seg for that, if your patch passes > check-world, than this behavior is not affected.=20 The proposed patch has no regression tests. If the current set is not enough to stress the problem, you surely should add some (haven't checked the patch in detail, sorry ;p ). -- Michael --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpgWeEACgkQnvQgOdby QH0zrA//SrVkYpiojy+gdaT3nCRCb9EzeJwWna6xy4khuR4zRwICXjLYUkdtS70k swzJsg7/6b3uEbYGhw21QKPQvAGJe5seGgli8fUziArK5TZU7b6v2FKVfpvuPGyw oFxXkTQmEzLbx5MlCYQXnubJNaOqNHC6Vd7TBSaucJl/xpUTh54JeYx1cE4hGW8e tVycFJgQeGZWwy3M2/pnSW1IezdlkXuxFfVlZI199ekhQ72jg6wUBTvo+U1tlCIU 7QpCXGaSY5HoabRMQTRV19ElYe5ajETnAePkYrfJ6loggKciJHtUZ81ar9y9y00/ gS3upydYfLER4+UwhtPmtyFhBF0G2Zv2EI58uGS7ZaRZQ5IWqoTX3SQQZaDUaJHt uwNyovUGk0dk/RNoFnDbrBUuAgxog3mSAOFJ7BFyH2ub9DyM4JCKpqzq98jBzR2p DBtlaOG8PF9jWWifNDWanxc9ueHnMHlQ7yDpsMqpYuInVyY2z/Tg1NRc2Ozf0SrM +wtgwCBWnpOzPNkYOwvSg/4OqQvj7sGvLTJE1MLzi6eJX5X9FYsgcSEYqilnFB1Z 0KsQtrZ4jbiZ/3bt61PyH9YNzwHYsQn0QUe8hqyIP+dLgHwGuZEJyx01+BjqRz9Z 3DSzcJTl9J4M5VqA4IWKg9+1qsRvpS3jrkG+5ClcUmat+uV4KLE= =m6y4 -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--