Re: Query with high planning time at version 11.1 compared versions10.5 and 11.0 - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: Query with high planning time at version 11.1 compared versions10.5 and 11.0
Date
Msg-id 20181128041750.GH30707@telsasoft.com
Whole thread Raw
In response to Re: Query with high planning time at version 11.1 compared versions10.5 and 11.0  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-performance
On Wed, Nov 28, 2018 at 05:03:15PM +1300, David Rowley wrote:
> Does it still take that long after running ANALYZE on the partitioned table?

Yes ; I've just reproduced the problem with a variation on Sanyo's query,
retrofitted onto the empty "partbench" table you used for testing in July:
https://www.postgresql.org/message-id/CAKJS1f8qkcwr2DULd%2B04rBmubHkKzp4abuFykgoPUsVM-4-38g%40mail.gmail.com

Note, Sanyo's original query appears to be a poor-man's window function,
joining two subqueries on a.value=max(b.value).

I reduced issue to this:

|postgres=# ANALYZE partbench;
|postgres=# explain SELECT * FROM (SELECT a.i2-b.i2 n FROM partbench a, (SELECT i2 FROM partbench)b)b, (SELECT
max(partbench.i3)m FROM partbench, (SELECT i3 FROM partbench)y )y WHERE m=n;
 
|Time: 31555.582 ms (00:31.556)

Justin


pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: Query with high planning time at version 11.1 compared versions10.5 and 11.0
Next
From: Scott Rankin
Date:
Subject: Slow Bitmap Index Scan