From: Tom Lane <tgl@sss.pgh.pa.us>
To: Corey Taylor <corey.taylor.fl@gmail.com>
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 09:57:17 -0400
Message-ID: <26981.1569247037@sss.pgh.pa.us> (raw)
In-Reply-To: <CADBz387VJq5QQ+S_E7ft7QNRdxhCtMUhGcRuYV=5TQrss50pjQ@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>
Corey Taylor <corey.taylor.fl@gmail.com> writes:
> I found after testing other situations, that the psql command would always
> finish as expected after canceling the first query that ran too long. I
> was able to reproduce this scenario with psql and pgadmin4 with various
> combinations.
Well, that's just weird.
It's well known that the second run of a query can be much faster due
to having fully-populated caches to draw on, but you seem to have a
case that may go beyond that. Maybe check for waiting on a lock?
It'd be useful to look in pg_stat_activity and/or top(1) while the
initial query is running, to see if it seems to be eating CPU or
is blocked on some condition. (I forget how thorough the
wait_event coverage is in 9.6, but it does at least have those
columns.)
Can you create a self-contained test case that acts like this?
regards, tom lane
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: tgl@sss.pgh.pa.us, corey.taylor.fl@gmail.com
Subject: Re: postgres 9.6: insert into select finishes only in pgadmin not psql
In-Reply-To: <26981.1569247037@sss.pgh.pa.us>
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>
* 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