Re: Performance of Query 4 on TPC-DS Benchmark

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Ba Jinsheng <bajinsheng(at)u(dot)nus(dot)edu>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Performance of Query 4 on TPC-DS Benchmark
Date: 2024-11-12 10:40:59
Message-ID: f7dfda30-a334-41a5-860e-74ba6fb46189@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 11/11/24 17:49, Ba Jinsheng wrote:
>
> >It is all the time a challenge for PostgreSQL to estimate such a filter
> >because of absent information on joint column distribution.
> >Can you research this way by building extended statistics on these
> >clauses? It could move the plan to the more optimal direction.
>
> Thanks a lot for your effort to analyze this issue, and we really
> appreciate your suggestions!  Currently, we focus on exposing these
> issues that affect performance. In the future, we may consider to look
> into such a direction as you suggested.
It would be better to participate in further analysis - at least, to
find out general solution and classify your findings.
For example in your query, if you replace CTE with a table (see in the
attachment) and execute vacuum analyze on this table you will have
well-estimated query which executes fast.

>
>
> > Have you tried any tools to improve the cardinality yet, like aqo [0]?
> Yes, but it takes nearly 1 hour to run this query at a time, so I only
> run "EXPLAIN ANALYZE" once, and the performance seems slightly improved.
Hmm, AQO iteratively approaches optimal decision. Sometimes it is a
local optimum, but we still don't have a method practical enough to kick
its out of the trap of local optimum.

--
regards, Andrei Lepikhov

Attachment Content-Type Size
tpcds-1.sql application/sql 14.5 KB
year_total.sql application/sql 2.2 KB

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2024-11-12 13:17:53 Re: tds_fdw : Severe performance degradation from postgresql 10.23 to 16.4
Previous Message Achilleas Mantzios - cloud 2024-11-12 10:37:27 Re: tds_fdw : Severe performance degradation from postgresql 10.23 to 16.4