Re: [HACKERS] Enhanced containment selectivity function - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] Enhanced containment selectivity function
Date
Msg-id 23644.1147440825@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Enhanced containment selectivity function  (Matteo Beccati <php@beccati.com>)
Responses Re: [HACKERS] Enhanced containment selectivity function  (Matteo Beccati <php@beccati.com>)
List pgsql-patches
Matteo Beccati <php@beccati.com> writes:
> It was a big surprise having no improvements at all in the query I used
> for all my previous tests, until I found out that the test against
> histogram values was removed by Tom. I strongly think it should be
> reintroduced: ltree columns are likely to have a unique constraint and
> the current ltreeparentsel function will behave just like contsel in
> these cases.

The histogram values seem completely meaningless in this context ---
for containment purposes, they are just ten or so randomly chosen
values.  I don't believe that the estimator works better with them.
Certainly, whether the column is unique or not is totally irrelevant
to whether they are representative.

What would seem saner to me is to add a datatype-specific analyze
function that collects some statistics that are actually relevant
to containment, and then make use of those in the estimator.

            regards, tom lane

pgsql-patches by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Next
From: Matteo Beccati
Date:
Subject: Re: [HACKERS] Enhanced containment selectivity function