pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Corey Taylor <corey.taylor.fl@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: postgres 9.6: insert into select finishes only in pgadmin not psql
Date: Mon, 23 Sep 2019 17:58:19 -0700
Message-ID: <7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com> (raw)
In-Reply-To: <CADBz3868gUM2TL25svb6x8UWWEEh21msf1zdFqNiSukzZEry_w@mail.gmail.com>
References: <CADBz384j3nVLiAHkLk+mXP4tszrs_QjdiNb6WnZ=v1+hzzvUQw@mail.gmail.com>
	<11667.1568842347@sss.pgh.pa.us>
	<CADBz387VJq5QQ+S_E7ft7QNRdxhCtMUhGcRuYV=5TQrss50pjQ@mail.gmail.com>
	<26981.1569247037@sss.pgh.pa.us>
	<CADBz384J5pvu2EV5DjC2eZOkG-bSNbjdHLD1qxd5Jt_pfhS2KQ@mail.gmail.com>
	<0745ddd3-0934-53d3-8b8d-41f2724f8247@aklaver.com>
	<CADBz38788sE8G54daHmfVYkaMhYTEdFyd--BtdF=2BOJGuj8Gw@mail.gmail.com>
	<ad7b0fa3-2502-f711-6237-72eb06e0f355@aklaver.com>
	<CADBz384k+ugWNODy80cU1qE6X0rzDHHuxqxihn-q1e9xFxm79g@mail.gmail.com>
	<0d6e6bd8-20db-5902-f5eb-7130ff5543d0@aklaver.com>
	<CADBz386QsbgwYyQWvbda_DNVcOtatV-djp=mrc8O-gmUHg4L1A@mail.gmail.com>
	<ce9ad78e-1f5a-332a-ba10-fc58de987dd7@aklaver.com>
	<CADBz3868gUM2TL25svb6x8UWWEEh21msf1zdFqNiSukzZEry_w@mail.gmail.com>

On 9/23/19 5:28 PM, Corey Taylor wrote:
> On Mon, Sep 23, 2019 at 7:23 PM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     "Once restored, it is wise to run ANALYZE on each restored table so the
>     optimizer has useful statistics; see Section 24.1.3 and Section 24.1.6
>     for more information."
> 
>     So is there some other step in the process that occurs after the
>     restore
>     and before you run your function?
> 
> 
> There are several other restore called and a delete query that clears 
> out an unrelated table.
> 
> However, I think this solves the issue for us and the mystery. The 
> ANALYZE was missing which reduces an unending query down to a minute.  
> The ANALZYE runs very quickly on its own so we're simply going to fix 
> the issue by following documented advice.

Aah, so it was the common case. Order is restored to the Postgres Universe:)

> 
> I guess the length of the query when before/during the ANALZYE felt like 
> something more was wrong.
> 
> corey


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (16+ messages)

Message-ID: <7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com>
Permalink:  ../7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com/
Also on:    postgresql.org/message-id/7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, corey.taylor.fl@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: postgres 9.6: insert into select finishes only in pgadmin not psql
  In-Reply-To: <7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com>
  References: <CADBz384j3nVLiAHkLk+mXP4tszrs_QjdiNb6WnZ=v1+hzzvUQw@mail.gmail.com> <11667.1568842347@sss.pgh.pa.us> <CADBz387VJq5QQ+S_E7ft7QNRdxhCtMUhGcRuYV=5TQrss50pjQ@mail.gmail.com> <26981.1569247037@sss.pgh.pa.us> <CADBz384J5pvu2EV5DjC2eZOkG-bSNbjdHLD1qxd5Jt_pfhS2KQ@mail.gmail.com> <0745ddd3-0934-53d3-8b8d-41f2724f8247@aklaver.com> <CADBz38788sE8G54daHmfVYkaMhYTEdFyd--BtdF=2BOJGuj8Gw@mail.gmail.com> <ad7b0fa3-2502-f711-6237-72eb06e0f355@aklaver.com> <CADBz384k+ugWNODy80cU1qE6X0rzDHHuxqxihn-q1e9xFxm79g@mail.gmail.com> <0d6e6bd8-20db-5902-f5eb-7130ff5543d0@aklaver.com> <CADBz386QsbgwYyQWvbda_DNVcOtatV-djp=mrc8O-gmUHg4L1A@mail.gmail.com> <ce9ad78e-1f5a-332a-ba10-fc58de987dd7@aklaver.com> <CADBz3868gUM2TL25svb6x8UWWEEh21msf1zdFqNiSukzZEry_w@mail.gmail.com> <7830f74b-f4cf-ece2-c088-52c2f621e6aa@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox