Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AD41F837B7B for ; Tue, 15 Nov 2011 16:39:25 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 71650-02 for ; Tue, 15 Nov 2011 20:39:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 9A4F3837B7A for ; Tue, 15 Nov 2011 16:39:16 -0400 (AST) Received: from moutng.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQPmh-0000TU-UE for pgsql-admin@postgresql.org; Tue, 15 Nov 2011 20:39:16 +0000 Received: from [192.168.1.3] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M9eFb-1RcGHF3OBz-00D82x; Tue, 15 Nov 2011 21:38:59 +0100 Message-ID: <4EC2CDE2.3000400@2ndQuadrant.com> Date: Tue, 15 Nov 2011 15:38:58 -0500 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: cancelled queries on standby References: <1321354003378-4994025.post@n5.nabble.com> In-Reply-To: <1321354003378-4994025.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:OP3ILF4RMIw3UcxkP4NAsf8dual6kKypBmBukaKUC3M aHFVDPmbgOKEdIeiiT2d9qoybQs5rzFQrzBE99MYojQ/txNP4M lAca3MvryPfL0gLBhl3U3Nrl//+tAV2cl/djnd8X56wE7Tzrzg pv5N206fkn/as1bLtS+YMtlWVYaLWLhHo2QKMm1qEFizZAGfi3 /UfS7DgihIA/OARPARCvPk+mxDj7VgEqJFJ1xAOE9JcyRhl11K S1ugrsMZ2R6uAu8ldFIrzkf1b4a5VpB4/nQA8w1wNhZjHL6zSR q1PEmZ6lnA4J4bTww2Jl5tBoV3mau49AAxRReT0SYvaAxVqBaZ P9jQ7n7qojzHGqlHGWR0= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/81 X-Sequence-Number: 38675 On 11/15/2011 05:46 AM, MirrorX wrote: > i am facing an issue concerning cancelled queries made on a hot standby > server. if we suppose that there are some tables that are never changed (no > inserts/updates/deletes) and that autovacuum is set to false for these > tables, what else could there be affecting these tables and consequently > cancelling my queries? thx in advance for any suggestions > Query cancellation isn't targeted this way. Whether or not a query needs to be canceled by vacuum cleanup depends on whether any open transaction can see the rows that are being cleaned up. I think you have the understandable belief what rows are actually being viewed by the query running on the standby matter; they don't. Let's say you have a long-running query Q accessing a table A on the standby. Then some vacuum cleanup of table B happens on the master. Q can then be canceled when those cleanup records are replicated. The fact that A is never changed and doesn't have autovacuum enabled doesn't matter. Because it's possible for Q to see B, it's canceled regardless of whether it's looked at it yet. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us