Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1UfM-000248-Bs for pgsql-performance@arkaria.postgresql.org; Thu, 08 Jul 2021 14:06:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1UfK-0003Bb-SM for pgsql-performance@arkaria.postgresql.org; Thu, 08 Jul 2021 14:06:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1UfK-0003BT-IP for pgsql-performance@lists.postgresql.org; Thu, 08 Jul 2021 14:06:10 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m1UfF-0006HL-La for pgsql-performance@lists.postgresql.org; Thu, 08 Jul 2021 14:06:09 +0000 Received: by mail-io1-xd2d.google.com with SMTP id q2so8236863iot.11 for ; Thu, 08 Jul 2021 07:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-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=AzP58+TUcfYhAAaa1/9sjpWWXkefOQL4WghhjREjQXg=; b=zWMbH9DVzgUyUolD/7jWB3dy6J8EGqUCBfJ0B4rik/bKNWGjE6E3vQdrtq5JXftSy5 C1HRHQmTNhf/cTM8OGLyJ2ReFMeXdPDiViGs4SjXtb5R4JWut2CulxCVcMOCTNzW23q9 i/RgMdGlpowiOmJeLWGZJlxoyKxUFikZCYdZD2z/c3vdiCRDNMki6baBKGLoxlvDOnaI aqaM0dsV22nP7ZqOnRHQhVN83kRfjNcIGjZQ3AioAge1XSCb92teAaYBRrcS63DhufRa PG0IpKXl23Obu2ZlujganhEhp5AMwmQkP7SEDgIF6phu5XTDvmUBxN6L2W4MdCLUvLRa VOiQ== 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=AzP58+TUcfYhAAaa1/9sjpWWXkefOQL4WghhjREjQXg=; b=qtDGqMif5Qfl2UxIfmH/ZHw0f7beNsizkaGFLqk4crsOFDGk7aZ6sydhtLn70F0ZCi a+/H+YDgV8yPouB8QtAtEX1gK8CRCo2hL/kiOSRGdwcWH9TLYIasumAo0l/uZG7iOLTv /wRD1/pWzCwPJGqGeGn2Uh1PE2HOLvis2Fyg7+BrdWYnxkZkwdVHdPvh8jyM6LPOOS5c HI34owuwxhHe0RpaQKWbTCOME0qXcLuLUKSTFJMUlntETbt/0NjZyVptCRNoRzjP0sul MjWEgaPDjelQpJLmGsRdmiLE15J6pA+4yR4P+LPUpvvl6/Bw89Zvg6ZANz93TE+COkt1 6BcQ== X-Gm-Message-State: AOAM532KqWR+K/t8wrwGcsyD1ESwvbqSZfN95AcSLPuZ5BGBeG1/Qp3y GVQuyofLRxmahnMC4Q0evBik2A== X-Google-Smtp-Source: ABdhPJw9YI8psxljMJTEzmlPAgMwfoHccdNW3l45z4KVfRja8XycCP1WEbrSmn1Oc9v8kZrvCKApzw== X-Received: by 2002:a05:6638:63c:: with SMTP id h28mr13841957jar.80.1625753164839; Thu, 08 Jul 2021 07:06:04 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 15sm1181260ilt.66.2021.07.08.07.06.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jul 2021 07:06:04 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 3F5E4800C52; Thu, 8 Jul 2021 09:06:03 -0500 (CDT) Date: Thu, 8 Jul 2021 09:06:03 -0500 From: Justin Pryzby To: Allan Barrielle Cc: pgsql-performance@lists.postgresql.org, Pierrick Martin Subject: Re: ETL - sql orchestrator is stuck when there is not sleep() between queries Message-ID: <20210708140603.GG22043@telsasoft.com> References: <20210708123320.GB22043@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 08, 2021 at 03:49:12PM +0200, Allan Barrielle wrote: > > Is it true that the SELECTs have no joins in them ? > > Yes there is a lot of LEFT JOIN. > > > It'd be very useful to get "explain analyze" for a working query and for a > > stuck query. It sound like the stuck query never finishes, so maybe the second > > part is impossible (?) > > We run an explain analysis and we see some very interesting stuff going on. > It seems without explicitly adding a `ANALYZE`, the query has a cost of > over billions, so the query is not stuck but took forever. > When I run the same scripts with an ANALYZE right before running the query, > the query is exec is 50secondes and the cost is normal It sounds like sometimes autoanalyze processes important tables being queried, but sometimes it doesn't. Since there are JOINs involved, you should analyze the tables after populating them and before querying them. The same as if it were a temp table, or anything else. > The configuration is tuned by aws aurora, [...] > fsync,off > full_page_writes,off really? > vacuum_cleanup_index_scale_factor,0.1 also interesting