Fwd: Query with high planning time compared to execution time

From: Richard Lee <swift1984(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Fwd: Query with high planning time compared to execution time
Date: 2018-11-02 09:36:41
Message-ID: CALhvPTS3XmDa7Px2WdZhyvwHPsqC=KKQ2kTsGL0KZiuwGF8C4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

I'm running a performance test for our application and encountered a
particular query with high planning time compared to the execution. Please
refer to attached explain.out for the explain analyze output.

Formatted explain: https://explain.depesz.com/s/R834

The test was performed with Jmeter sending requests to the database, query
was generated by Hibernate which consists of a 133 table UNION. Also
attached are some diagnostic info (database version, database settings,
table definitions and maintenance related information).

Due to the extremely large query text, I'm choosing to provide information
via attachments instead of pasting in the email body.

Below are some additional OS information on the database server:
CPU: 8
RAM: 24GB
Disk: SSD
OS: CentOS Linux release 7.4.1708 (Core)

[root(at)kvrh7os202 ~]# uname -a
Linux kvrh7os202.comptel.com 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7
19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root(at)kvrh7os202 ~]#

Things I tried:
1. Setting random_page_cost = 1.1 and effective_io_concurrency = 200 - no
effect on planning time
2. Create materialized view for big UNION query - planning time reduced
significantly but not a viable solution

What are my other options to improve the query planning time?

Regards,
Richard Lee

Attachment Content-Type Size
explain.out application/octet-stream 72.8 KB
diag_info.zip application/zip 77.0 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2018-11-02 13:55:17 Re: Fwd: Query with high planning time compared to execution time
Previous Message Michael Paquier 2018-10-31 09:55:01 Re: SCRAM question