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 1iHDB4-0001Dr-6V for pgsql-performance@arkaria.postgresql.org; Sun, 06 Oct 2019 20:30:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHDB0-0006wj-MJ for pgsql-performance@arkaria.postgresql.org; Sun, 06 Oct 2019 20:30:46 +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 1iHDB0-0006wX-80 for pgsql-performance@lists.postgresql.org; Sun, 06 Oct 2019 20:30:46 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHDAw-00061t-Fq for pgsql-performance@lists.postgresql.org; Sun, 06 Oct 2019 20:30:45 +0000 Received: by mail-wr1-x444.google.com with SMTP id o18so12764344wrv.13 for ; Sun, 06 Oct 2019 13:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DJwen7y8OcZGxA5Oc3VCe+/K0zHBKVSdo2ZV5Nr8efU=; b=y91VZCQGMbQV6amvfCng/5Zmns0RlMokTZzSCh3vp9ljwlIWnjeXGwcnh/njQ+YakP SOZV4UbR3QLEMqywzdPeqSYba6RXVqpYBwzOR3aCWVoo+4viXfCJppKp1iENJkx2Yk/j WzKImSSd2r7EF72SnUV0kBviUUlTJSCCYHQnM+LBQBTkRE0i7aVAmiK+mnhu29w3dw/2 hfTnEsck3Qntan+McIvR4HngCw1vqFTF59lJga+WngOpfcpurUfEpW0uqeozCEm9CwH5 d4X68wQ3eW2dxtuCLN9FfZGl+LGzjyz2lAje3Yt9lCxxniFYtcYed/DwbTUIY4IUfv3g AxlQ== 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:user-agent; bh=DJwen7y8OcZGxA5Oc3VCe+/K0zHBKVSdo2ZV5Nr8efU=; b=A05PhvuzmwdKJfjNK40SXX0YePWdxBm3KThBCtbBnXq3gyYgUOaPksEkRu9vzFUz+8 MLfnoDd90ydUgNfSCa2QZjOLCLEOoQU1swQGqP/S7zwBqtrSJCdBZPKzemN8//eF8uLI xLmcN9nrfN6STqGAG/cDqC4xLVa7PFtzvNB4QhZuXLexqWd92ZHT4h+jvD6NEG8LTHBs Bp/oMxAVm5mDaf1P8vLlSPVb6odJ2CqBeNJD0s5xxObb2aAskT1c66dDHKfZRzt+RrKx GqsyL955nTf2+fQLyIvIwjXHTJUdO30jPx5h7ppBC6RRzwxNN8ChGvbpRaoineKa1FUc hZaw== X-Gm-Message-State: APjAAAUFpYnfm78mEreDRvseErXESDiq/h/xaFE0puMEpiw5fyEUp/s5 9RtHUCsH6ZHPCtRIQ2/mxFKXGQ== X-Google-Smtp-Source: APXvYqw4O4vT+RIzof5EANeOd6ri6yCIG6c8G8kfMvw0hxCGWh15uBm0Txn9c+FdzEWB0WhZmD0IeA== X-Received: by 2002:a5d:670f:: with SMTP id o15mr18963844wru.242.1570393841401; Sun, 06 Oct 2019 13:30:41 -0700 (PDT) Received: from localhost (ip-86-49-253-183.net.upcbroadband.cz. [86.49.253.183]) by smtp.gmail.com with ESMTPSA id m7sm9991662wrv.40.2019.10.06.13.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2019 13:30:40 -0700 (PDT) Date: Sun, 6 Oct 2019 22:30:39 +0200 From: Tomas Vondra To: nikhil raj Cc: Justin Pryzby , pgsql-performance@lists.postgresql.org Subject: Re: Query went slow all of sudden. ON V 11.3 Message-ID: <20191006203039.66or5a6c7avjyhcc@development> References: <20191004132044.GB11241@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Oct 04, 2019 at 07:28:54PM +0530, nikhil raj wrote: >Hi Justin, > >Its been executing for 35 + mins due to statement time out its getting >canceled. > Well, without a query plan it's really hard to give you any advice. We need to see at least EXPLAIN output (without analyze) to get an idea of how the query will be executed. Even better, disable the statement timeout in the session and dive use EXPLAIN ANALYZE. Of course, it's unclear how long it'll run. Earlier you mentioned the query started running fast after you recreated one of the tables. That likely means the table (or the indexes on it) are getting bloated over time. Try looking at the sizes of those objects (and maybe use pgstattuple to get more detailed statistics before rebuilding it next time. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services