Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Дата
Msg-id 199907311650.MAA27601@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> OK, I haven't heard any objections to my last proposal for improving
> selectivity estimates for "=", so I'm going to bull ahead and implement it.
> 
> This will require adding columns to a system table, which I've never
> done before.  There are some attribute statistics in pg_attribute and
> some in pg_statistic, but it looks like changing pg_attribute is a
> pretty dangerous business, so I'm inclined to leave pg_attribute alone
> and just add columns to pg_statistic.
> 
> Do I need to do anything beyond making the obvious additions to
> catalog/pg_statistic.h, rebuild, and initdb?  I see that pg_attribute.h
> doesn't contain any handmade entries for pg_statistic, so that at least
> is no problem...

No, that's pretty much it.  You have to make sure you get it all
correct, or it will not work, but you know that.  The only other thing
is that you have to make sure that every insert into pg_statistic in the
backend knows about the new fields.  I do that by looking for all
references to pg_statistic in the backend, and making sure I have the
new fields covered.  If you add a varlena field, and there is an index
on the table, you may have to add something to the cache.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Roberth Andersson
Дата:
Сообщение: Re: [HACKERS] IPC Memory problem with Postmaster on BSDi 4.x
Следующее
От: Ryan Kirkpatrick
Дата:
Сообщение: Re: [HACKERS] Re: [PORTS] RedHat6.0 & Alpha