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 0
	2. set relpages=2 and a calculated reltuples 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


Wed, 26 May 1999 09:58:44 +0200
ZEUGSWETTER Andreas IZ5 <Andreas.Zeugswetter@telecom.at>
AW: AW: [HACKERS] create index updates nrows statistics