From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Merlin Moncure <mmoncure@gmail.com>
To: Melvin Davidson <melvin6925@gmail.com>
Cc: Ravi Tammineni <rtammineni@partner.aligntech.com>
Cc: Chris Mair <chris@1006.org>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Queries are taking way longer in 9.6 than 9.5
Date: Wed, 18 Jan 2017 21:10:50 -0800
Message-ID: <e1c2aa5f-f85f-5644-b1c1-606cb907dc76@aklaver.com> (raw)
In-Reply-To: <CAHyXU0yUtRHu_uPoK+aqinzF+b1MPoWLVUoDqeThi-_tUv7TSw@mail.gmail.com>
References: <MWHPR02MB2655591A4E27B425FABD5E93807C0@MWHPR02MB2655.namprd02.prod.outlook.com>
<a0680eb9d03df0f54690eb2a7351744e@smtp.hushmail.com>
<MWHPR02MB265508B2200BD5A17DDE5DA3807C0@MWHPR02MB2655.namprd02.prod.outlook.com>
<70190c66-cf64-4741-1cd7-a6cf08f4101f@2ndquadrant.com>
<dfa066c765ed68b8564a30322467e6dc@smtp.hushmail.com>
<MWHPR02MB2655A38548EDFA9C874C5EDF807F0@MWHPR02MB2655.namprd02.prod.outlook.com>
<CAHyXU0xSSy0C-oZ9KFWJ0SK0v7NNNqTZ0A1whguaDLAAKNEmxA@mail.gmail.com>
<CANu8Fiy0Ln9a8XJ+DH2NNKXAL6sLadhQGQbS_bGVZkrPaX77qg@mail.gmail.com>
<CAHyXU0yUtRHu_uPoK+aqinzF+b1MPoWLVUoDqeThi-_tUv7TSw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>
On 01/18/2017 08:58 PM, Merlin Moncure wrote:
> On Wed, Jan 18, 2017 at 2:12 PM, Melvin Davidson <melvin6925@gmail.com
> <mailto:melvin6925@gmail.com>> wrote:
>
>
>
> On Wed, Jan 18, 2017 at 3:06 PM, Merlin Moncure <mmoncure@gmail.com
> <mailto:mmoncure@gmail.com>> wrote:
>
> On Wed, Jan 18, 2017 at 1:04 PM, Ravi Tammineni
> <rtammineni@partner.aligntech.com
> <mailto:rtammineni@partner.aligntech.com>> wrote:
> > Hi Chris,
> >
> > Here is the query and execution plan in 9.5 and 9.6.
>
> Can you verify tblpuorderstatus and tblpuorderstatushistory have all
> indexes accounted for on both servers? It seems incredible server
> would prefer wading through 11M records to 1298 nestloop. I'm
> curious
> what plans you get if you try playing around with:
>
> set enable_seqscan=false;
> set enable_hashjoin=false;
>
> ...but I think we have two possibilities here:
> 1. schema mismatch
> 2. planner bug
>
> merlin
>
>
> --
> Sent via pgsql-general mailing list
> (pgsql-general@postgresql.org <mailto:pgsql-general@postgresql.org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
> <http://www.postgresql.org/mailpref/pgsql-general;
>
>
> *I never got an answer to my question.
> *
> *Have you verified that postgresql.conf is the same of both 9.5 & 9.6?*
>
>
> This is not verified, but I can't think of an influential planner
> variable that would push planner cost from 2600 to millions; abrupt
> increase in plan cost roles out a knife edge plan choice and the
> statistic look relatively correct on rows. Unless planner choices are
> disabled in postgresql.conf, this suggests something is preventing
> planner from choosing a particular kind of plan for this query, which is
> suggesting bug to me.
I am still working out the parallel query feature in 9.6 but I am seeing
the below in the 9.6 EXPLAIN ANALYZE:
-> Gather (cost=1000.00..3011004.71 rows=529690 width=4) (actual
time=2.713..368445.460 rows=595653 loops=1)
Workers Planned: 2
Workers Launched: 2
Does that not indicate parallel query has been turned on?
Would not turning it off be a better apple-to-apple comparison to the
9.5 plan?
>
> OP, if you want to contribute to the investigation of fix, "git bisect"
> is the way to proceed...is that feasible?
>
> merlin
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
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-admin@postgresql.org
Cc: adrian.klaver@aklaver.com, mmoncure@gmail.com, melvin6925@gmail.com, rtammineni@partner.aligntech.com, chris@1006.org, tomas.vondra@2ndquadrant.com, pgsql-general@postgresql.org
Subject: Re: Queries are taking way longer in 9.6 than 9.5
In-Reply-To: <e1c2aa5f-f85f-5644-b1c1-606cb907dc76@aklaver.com>
References: <MWHPR02MB2655591A4E27B425FABD5E93807C0@MWHPR02MB2655.namprd02.prod.outlook.com> <a0680eb9d03df0f54690eb2a7351744e@smtp.hushmail.com> <MWHPR02MB265508B2200BD5A17DDE5DA3807C0@MWHPR02MB2655.namprd02.prod.outlook.com> <70190c66-cf64-4741-1cd7-a6cf08f4101f@2ndquadrant.com> <dfa066c765ed68b8564a30322467e6dc@smtp.hushmail.com> <MWHPR02MB2655A38548EDFA9C874C5EDF807F0@MWHPR02MB2655.namprd02.prod.outlook.com> <CAHyXU0xSSy0C-oZ9KFWJ0SK0v7NNNqTZ0A1whguaDLAAKNEmxA@mail.gmail.com> <CANu8Fiy0Ln9a8XJ+DH2NNKXAL6sLadhQGQbS_bGVZkrPaX77qg@mail.gmail.com> <CAHyXU0yUtRHu_uPoK+aqinzF+b1MPoWLVUoDqeThi-_tUv7TSw@mail.gmail.com> <e1c2aa5f-f85f-5644-b1c1-606cb907dc76@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