custom statistic collector

From: "Ilia Kantor" <ilia(at)obnovlenie(dot)ru>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: custom statistic collector
Date: 2005-08-29 21:18:21
Message-ID: auto-000559004770@umail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

1)

I want to test my own selectivity function against future stats collector.

Is this a right way to update statistic used by planner ?

update pg_statistic set
stadistinct=4,stakind3=11111,stanumbers3=array[0.8,0.2],stavalues3=array[100
00,10001] where starelid=950855 and staattnum = 21;

stadistinct values total, stakind3 is my custom STATISTIC_KIND, stanumber3
are frequencies of stavalues3.

2)

How to add custom statistic kind for 1-dim array of integers (_int4) ?

Currently it uses standard compute_scalar_stats (commands/analyze.c).

Custom statistic is needed to count selectivity for GIST built by
contrib/intarray.

It should be gathered only for 1-dim arrays and contain most-common values
met in among all arrays,

Distinct values among all arrays etc.

Generally, it can be gathered on anyarray(not only _int4), but it's ok for
me (yet) to have it working for _int4 1-dim only.

Pitifully, I have no idea what is the right way of putting such thing into
existing system..

Should I add switches into analyze.c or there exist a better way ?

Maybe one could sketch out the structure of what is to be done.

Browse pgsql-hackers by date

  From Date Subject
Next Message Mary Edie Meredith 2005-08-29 21:36:37 Re: data on devel code perf dip
Previous Message Simon Riggs 2005-08-29 21:13:11 Performance gain from reduction of GROUP BY memory allocations