Re: pg_stat_advisor extension

From: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_stat_advisor extension
Date: 2024-02-06 16:08:05
Message-ID: 96fece4e-c4ec-4493-80c5-2e35be2d1d25@tantorlabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-06 16:32:13 Re: Reducing connection overhead in pg_upgrade compat check phase
Previous Message Ilia Evdokimov 2024-02-06 15:27:36 Re: pg_stat_advisor extension