Re: pg_stat_advisor extension - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: pg_stat_advisor extension
Date
Msg-id 96fece4e-c4ec-4493-80c5-2e35be2d1d25@tantorlabs.com
Whole thread Raw
In response to Re: pg_stat_advisor extension  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Responses Re: pg_stat_advisor extension
Re: pg_stat_advisor extension
List pgsql-hackers
Dear Team,

Firstly, I would like to extend my sincere apologies for the confusion 
and technical oversights in our previous discussions regarding the 
'pg_stat_advisor extension'. To address this and facilitate a clearer, 
more focused dialogue, I have initiated a new thread to consolidate our 
discussions on this matter.

For context, our previous conversation can be found here: 
https://www.postgresql.org/message-id/flat/4681151706615977%40mail.yandex.ru.

The extension 'pg_stat_advisor' extension is architected to optimize 
query plan. It operates by suggesting when to create extended 
statistics, particularly in queries where current selectivity estimates 
fall short. This is achieved through the GUC parameter 
'pg_stat_advisor.suggest_statistics_threshold', which assesses the ratio 
of total tuples compared to the planned rows. This feature is 
instrumental in identifying scenarios where the planner's estimates 
could be optimized.

You can install the extension by:

```

LOAD 'pg_stat_advisor'

SET pg_stat_advisor.suggest_statistics_threshold = 1.0;

```


Example:

```

EXPLAIN ANALYZE SELECT * FROM t WHERE i = 100 AND j = 10;

NOTICE: pg_stat_advisor suggestion: CREATE STATISTICS t_i_j ON i, j FROM t

                                                         QUERY PLAN

--------------------------------------------------------------------------------------------------------

```

After EXPLAIN ANALYZE command you can see the message of suggestion 
creating statistics with name 't_i_j' on 'i', 'j' columns from 't' table.

Thank you for your understanding, patience, and continued support.



Best regards,
Ilia Evdokimov,
Tantor Labs LLC.



pgsql-hackers by date:

Previous
From: Ilia Evdokimov
Date:
Subject: Re: pg_stat_advisor extension
Next
From: Nathan Bossart
Date:
Subject: Re: Reducing connection overhead in pg_upgrade compat check phase