Re: [HACKERS] Enhanced containment selectivity function

From: Matteo Beccati <php(at)beccati(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Enhanced containment selectivity function
Date: 2006-05-12 13:56:03
Message-ID: 446493F3.3020503@beccati.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi,

> 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.

Right, but if the column has a high number of stats, I think that the
samples found in the histogram could put the estimator on the right way:
i.e. in my case 80% of the values have '1041' as their root leaf and
most of the values in the histogram reflect this.

You're right saying that the column uniqueness isn't relevant to the
histogram, but if the column is unique, there won't be any mcv, and the
patch becomes useless.

> 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.

Perhaps you're right, but unfortunately it's not a thing I can do
myself, because of lack of knowledge about both pg and ltree internals :(

Best regards
--
Matteo Beccati
http://phpadsnew.com
http://phppgads.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-12 13:57:52 Re: Compiling on 8.1.3 on Openserver 5.05
Previous Message Tom Lane 2006-05-12 13:46:21 Re: any, anyelement, and anyarray

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Brant 2006-05-12 18:00:29 Re: [HACKERS] Question on win32 semaphore simulation
Previous Message Tom Lane 2006-05-12 13:33:45 Re: [HACKERS] Enhanced containment selectivity function