Re: extended statistics n-distinct on multiple columns not used when join two tables

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>
Subject: Re: extended statistics n-distinct on multiple columns not used when join two tables
Date: 2023-06-13 11:25:53
Message-ID: CAApHDvrMuVgDOrmg_EtFDZ=AOovq6EsJNnHH1ddyZ8EqL4yzMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

(moving to -hackers)

On Tue, 13 Jun 2023 at 21:30, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> út 13. 6. 2023 v 11:21 odesílatel James Pang (chaolpan) <chaolpan(at)cisco(dot)com> napsal:
>> When join two table on multiple columns equaljoin, rows estimation always use selectivity = multiplied by distinct multiple individual columns, possible to use extended n-distinct statistics on multiple columns?
>>
>> PG v14.8-1, attached please check test case with details.
>
> There is not any support for multi tables statistic

I think it's probably worth adjusting the docs to mention this. It
seems like it might be something that could surprise someone.

Something like the attached, maybe?

David

Attachment Content-Type Size
mention_ext_stats_dont_work_for_joins.patch application/octet-stream 769 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-06-13 11:28:34 Re: extended statistics n-distinct on multiple columns not used when join two tables
Previous Message Ranier Vilela 2023-06-13 11:21:20 Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2023-06-13 11:28:34 Re: extended statistics n-distinct on multiple columns not used when join two tables
Previous Message Pavel Stehule 2023-06-13 09:29:49 Re: extended statistics n-distinct on multiple columns not used when join two tables