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 1iB2uK-0005K0-Nl for pgsql-performance@arkaria.postgresql.org; Thu, 19 Sep 2019 20:20:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iB2uJ-0001Oj-EX for pgsql-performance@arkaria.postgresql.org; Thu, 19 Sep 2019 20:20:03 +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 1iB2uJ-0001OZ-4m for pgsql-performance@lists.postgresql.org; Thu, 19 Sep 2019 20:20:03 +0000 Received: from hm1831-41.locaweb.com.br ([189.126.112.61]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iB2uE-0004hu-Sw for pgsql-performance@lists.postgresql.org; Thu, 19 Sep 2019 20:20:01 +0000 Received: from mcbain0012.correio.biz (189.126.112.16) by hm1831-n-113.locaweb.com.br id hgfhe215ctou for ; Thu, 19 Sep 2019 17:19:41 -0300 (envelope-from ) Received: from proxy.email-ssl.com.br (bartf0031.email.locaweb.com.br [10.31.120.63]) by mcbain0012.correio.biz (Postfix) with ESMTP id B5D818C04D5; Thu, 19 Sep 2019 17:19:39 -0300 (-03) x-locaweb-id: qyHzKK_R8aWhjwoIerpCUhsi5PfCUymhK53qXIAegdcRogeYX3-XTadcSpgGGxitWQf3rKGbFuqvLmn5XdJ_XeDnSC7FYZn7HbLXpGF-9IgCFmgQGgrxCDEo15F9LB44OnsLfXjEQNdayh8qp-s9AotEt2KUQ2RJBl9oRDY6_jQGONTy23UbTLyu956pUuVT8UlUgaIM6XARSVi84RGoZ3y_BYb-aN8PXpaI7MRvykI= NmM3NTY5NzM3MjZmNjI2NTcyNzQ2ZjQwNzM2OTczNjM2ZjYyNzI2MTJlNjM2ZjZkMmU2Mjcy x-locaweb-id: qyHzKK_R8aWhjwoIerpCUhsi5PfCUymhK53qXIAegdcRogeYX3-XTadcSpgGGxitWQf3rKGbFuqvLmn5XdJ_XeDnSC7FYZn7HbLXpGF-9IgCFmgQGgrxCDEo15F9LB44OnsLfXjEQNdayh8qp-s9AotEt2KUQ2RJBl9oRDY6_jQGONTy23UbTLyu956pUuVT8UlUgaIM6XARSVi84RGoZ3y_BYb-aN8PXpaI7MRvykI= NmM3NTY5NzM3MjZmNjI2NTcyNzQ2ZjQwNzM2OTczNjM2ZjYyNzI2MTJlNjM2ZjZkMmU2Mjcy x-locaweb-id: qyHzKK_R8aWhjwoIerpCUhsi5PfCUymhK53qXIAegdcRogeYX3-XTadcSpgGGxitWQf3rKGbFuqvLmn5XdJ_XeDnSC7FYZn7HbLXpGF-9IgCFmgQGgrxCDEo15F9LB44OnsLfXjEQNdayh8qp-s9AotEt2KUQ2RJBl9oRDY6_jQGONTy23UbTLyu956pUuVT8UlUgaIM6XARSVi84RGoZ3y_BYb-aN8PXpaI7MRvykI= NmM3NTY5NzM3MjZmNjI2NTcyNzQ2ZjQwNzM2OTczNjM2ZjYyNzI2MTJlNjM2ZjZkMmU2Mjcy X-LocaWeb-COR: locaweb_2009_x-mail X-AuthUser: luisroberto@siscobra.com.br Received: from [192.168.0.42] (unknown [189.45.198.123]) (Authenticated sender: luisroberto@siscobra.com.br) by proxy.email-ssl.com.br (Postfix) with ESMTPSA id 83C4AB013A3; Thu, 19 Sep 2019 17:19:51 -0300 (-03) Cc: Michael Lewis , "pgsql-performance@lists.postgresql.org" Subject: Re: Slow query on a one-tuple table To: Igor Neyman References: <24571.1568910502@sss.pgh.pa.us> <774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br> From: =?UTF-8?Q?Lu=c3=ads_Roberto_Weck?= Message-ID: <18ae8108-acaf-e9cc-96a9-ab20f4147f5a@siscobra.com.br> Date: Thu, 19 Sep 2019 17:24:39 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pt-BR List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Em 19/09/2019 17:11, Igor Neyman escreveu: > With LIMIT 1, I get 3 shared buffers hit, pretty much always. > > ____________________________________________________________________________________ > > Check if assessoria_pkey index is bloated. > > Regards, > Igor Neyman > > With this query[1] it shows: current_database|schemaname|tblname   |idxname |real_size|extra_size|extra_ratio|fillfactor|bloat_size|bloat_ratio|is_na| ----------------|----------|----------|---------------|---------|----------|-----------|----------|----------|-----------|-----| database_name   |public    |assessoria|assessoria_pkey| 16384|         0|        0.0|        90|       0.0| 0.0|false| [1]https://github.com/ioguix/pgsql-bloat-estimation/blob/master/btree/btree_bloat-superuser.sql