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 1iBIfc-0000l1-Ux for pgsql-performance@arkaria.postgresql.org; Fri, 20 Sep 2019 13:09:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iBIfa-0008PA-GI for pgsql-performance@arkaria.postgresql.org; Fri, 20 Sep 2019 13:09:54 +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 1iBIfa-0008P2-7G for pgsql-performance@lists.postgresql.org; Fri, 20 Sep 2019 13:09:54 +0000 Received: from mout.perfora.net ([74.208.4.194]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iBIfS-0005p7-Ty for pgsql-performance@lists.postgresql.org; Fri, 20 Sep 2019 13:09:53 +0000 Received: from [192.168.1.101] ([98.169.208.73]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LloAA-1hbxqc3wB6-00ZOBk; Fri, 20 Sep 2019 15:09:39 +0200 Subject: Re: Slow query on a one-tuple table To: Tom Lane Cc: =?UTF-8?Q?Lu=c3=ads_Roberto_Weck?= , Michael Lewis , pgsql-performance@lists.postgresql.org References: <24571.1568910502@sss.pgh.pa.us> <774d6080-d6d7-e9e7-7351-9a412c7d5956@siscobra.com.br> <18ae8108-acaf-e9cc-96a9-ab20f4147f5a@siscobra.com.br> <35df2bd8-4c7c-7ace-6bdc-d6d97a101a14@siscobra.com.br> <1980a708-ed4a-6fc6-2792-33c07b07d704@siscobra.com.br> <18657.1568933831@sss.pgh.pa.us> From: MichaelDBA Message-ID: <2d20142b-16b4-32e9-cf63-81d813d4718c@sqlexec.com> Date: Fri, 20 Sep 2019 09:09:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/6.1.18 MIME-Version: 1.0 In-Reply-To: <18657.1568933831@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:QUFs0CTN4tzeFUyIcbKmX6/4N5DKlhBJQCdIGroJEWeHGuxk82p 6FmF4jg3ePFRbQWfyl32yaiQ5a0J7T0nKiADGob4p4EKeC6V1V4gUnbwWt9X/5q7TTUkMO6 prs1AJgjmxnfdRhxgU/zqx+Io/e4knXxNkPPyGm6xrNzH19dL3MYdFNooMCLcvJBaiX9Ldu X9+dKe0109dyU5JGncijw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xKOAa3bb6fk=:4WSBLlT4kiUi/LzAMdydyp q2WISpq/IZlRUy8ZprPeoDpd4rYiIWt2ARK1CF9CuB+IJ6XAw8DtkNp6sJmej1aA9YyLjddVy uD2u1zqtsaYWp0XCpzPnq5hHvSfPvWhtBwuu68WOnAbXvVeBFkG0W5mFz52p1zhvNhVHKoAD4 L0R1IcHidTYlQF+/+GX3DgE4PHESwJXmfUn0K9ZiWhaBHlQ2gJ/jdq6wDjehjbCx/Bft/eIyn 22gV/1aq3dnbVMfjYJWniw7Ev+T93NFw84VDCdES+rmRfdq4mgHIBa5f8aRGsLxIWbWzjfZQ+ IpQa52d9ZFk/deVf8a73ZJBKaEOJI1W8P++xR4SaBWWxipOIpyc0nFgMCGaLBvVKEhuitzmhD jdPmtMFAZck3SLwglHFw2iNm/3Dr3bqQ+6OgblmqQw3HtUiI9rXmGcVn1DSHsh9OEwMj/uLat dq3t6EJ3rJ4lo4Hp+vVZHrs8NCQH+tAp1fsiHs5Zsoj//ySmvzxo5LxSijhSvGffvjtjPe6Ps HdZBBHAUuZvEjtxiis9jkY+pdsou2mQeYhRVUDkfl6F/VDZbHbeiwyq1OSkE8qH6oF/UJ8sDE Cu2JtE36LLk/KRlDIEUNapALKoDBmCrX0T9Kn7+9ZQe2CZMqOF1TSiMjZSEM+Wqk5t48iDJjT XPmJfuViJAiQtKUQQXPCIIOMGgwlPl31Fi9HcMq0LV6Hp57NFpDPJWMEKKhOdVLrx3a6D3D9q misxUFXA7IR0RyQdSIyU0n1mLHjimfDGM7wS2yFQLLeAacg3DPvNW//U6dhWNEz/Cfo8wOvph IggZ/wOgmQ0C1MjfIdIYCoaOLxEzdL1m/NP7b/Aa6A0btQ7qHrgeZwxwZYBckTNv7aFzXDwsK q3wDCu4Ppj0hWOvIijcthlZMNoADFJZYRo3boyebc= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi all, I sometimes set autovacuum_vacuum_scale factor = 0 but only when I also set autovacuum_vacuum_threshold to some non-zero number to force vacuums after a certain number of rows are updated.  It takes the math out of it by setting the threshold explicitly. But in this case he has also set autovacuum_vacuum_threshold to only 25!  So I think you have to fix your settings by increasing one or both accordingly. Regards, Michael Vitale Tom Lane wrote on 9/19/2019 6:57 PM: > =?UTF-8?Q?Lu=c3=ads_Roberto_Weck?= writes: >> As fas as autovacuum options, this is what I'm using: >> autovacuum_vacuum_scale_factor=0, > Ugh ... maybe I'm misremembering, but I *think* that has the effect > of disabling autovac completely. You don't want zero. > > Check in pg_stat_all_tables.last_autovacuum to see if anything > is happening. If the dates seem reasonably current, then I'm wrong. > > regards, tom lane > >