public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Ba Jinsheng <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: Performance of Query 4 on TPC-DS Benchmark
Date: Tue, 12 Nov 2024 17:40:59 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <SEZPR06MB649449C88C484B0BDE17A9C28A582@SEZPR06MB6494.apcprd06.prod.outlook.com>
References: <SEZPR06MB6494F6A2837995BDD4E0BF9A8A5F2@SEZPR06MB6494.apcprd06.prod.outlook.com>
	<[email protected]>
	<SEZPR06MB649449C88C484B0BDE17A9C28A582@SEZPR06MB6494.apcprd06.prod.outlook.com>

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

Attachments:

  [application/sql] tpcds-1.sql (14.5K, ../[email protected]/2-tpcds-1.sql)
  download

  [application/sql] year_total.sql (2.2K, ../[email protected]/3-year_total.sql)
  download

view thread (8+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Performance of Query 4 on TPC-DS Benchmark
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox