From: John Scalia <jayknowsunix@gmail.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Explain plan on a Select query
Date: Mon, 16 Mar 2020 20:38:45 -0400
Message-ID: <62998F18-D770-4521-9CE0-C11A565825FE@gmail.com> (raw)
In-Reply-To: <CAMkU=1yQ11TNr9mmUiaW6SkmSL92JCLrC6XZ1AFGD97oyQXvPg@mail.gmail.com>
References: <CAMkU=1yQ11TNr9mmUiaW6SkmSL92JCLrC6XZ1AFGD97oyQXvPg@mail.gmail.com>
Well, after rebuilding the statistics on the table at least three separate times, the errant messages finally disappeared. BTW, this was on an AWS RDS instance, which I know is not the favorite of any development team member. It just threw me a bit, as the first analyze did not clear the issue.
Sent from my iPad
> On Mar 16, 2020, at 6:43 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>
>
>> On Mon, Mar 16, 2020 at 12:26 PM John Scalia <jayknowsunix@gmail.com> wrote:
>
>> I’m a bit confused on an explain plan I just generated for a select statement. The plan’s first line begins with the word “Append” followed by the usual (cost....) data. What in the world is an Append doing here? I’ve recently performed another analyze on the table, btw.
>
> A top level Append would generally be used when you use a UNION ALL, or you have inheritance.
>
>>
>> Also, the query does not seem to be using an index, as the explain shows a pair of sequential scans, speaking of which, the second sequential scan shows it’s on a table, called <table>_test. Which is a little strange, considering that does not exist.
>
> Is that the name of the table, or the alias for that table?
>
> "-> Seq Scan on pgbench_accounts pa_alias (cost=0.00..527869.00 rows=20000000 width=97)"
>
> "pgbench_accounts" is the actual table, "pa_alias" is the alias for it.
>
>
> PostgreSQL will create alias for table when it needs to, but I've never seen it do so by adding "_test" to the end. Usually it adds "_" and an integer.
>
> It would really help to be able to see either the plan or the query, or both.
>
> Cheers,
>
> Jeff
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: jayknowsunix@gmail.com, jeff.janes@gmail.com
Subject: Re: Explain plan on a Select query
In-Reply-To: <62998F18-D770-4521-9CE0-C11A565825FE@gmail.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