AW: AW: [HACKERS] create index updates nrows statistics

Поиск
Список
Период
Сортировка
От ZEUGSWETTER Andreas IZ5
Тема AW: AW: [HACKERS] create index updates nrows statistics
Дата
Msg-id 219F68D65015D011A8E000006F8590C60267B37A@sdexcsrv1.f000.d0188.sd.spardat.at
обсуждение исходный текст
Список pgsql-hackers
Jan wrote:
>     From memory not verified:
> 
>     Doesn't CREATE INDEX update pg_statistics? 
> 
No.

> I think it does so
> the faked statistics only cause different joins to happen  as
> long  as  there  is no index created immediately after CREATE
> TABLE (HASHJOIN vs. NESTLOOP).
> 
No, create index on a newly created table does:1. set reltuples and relpages of the table to 02. set relpages=2 and a
calculatedreltuples of 2048 or below   on the index depending on how many multy columns
 

This leads to a rather strange state where reltuples of table <
reltuples of index. It forces seq scans on update and select
of single table. (see E. Mergl's update problem)

Andreas



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

Предыдущее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: AW: [HACKERS] create index updates nrows statistics
Следующее
От: Oleg Bartunov
Дата:
Сообщение: 6.5 cvs: weird crashes