Re: index creation order? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: index creation order?
Date
Msg-id 200310311058.19455.josh@agliodbs.com
Whole thread Raw
In response to Re: index creation order?  (Allen Landsidel <all@biosys.net>)
Responses Re: index creation order?
List pgsql-performance
Allen,

> I had no idea analyze was playing such a big role in this sense.. I really
> thought that other than saving space, it wasn't doing much for tables that
> don't have indexes on the.

Among other things, ANALYZE tells postgres how many rows are in the table.  So
if you add a PK constraint after loading 10 million rows without ANALYZE,
PostgreSQL is likely to think that there is only one row in the table ... and
choose a nested loop or some other really inefficient method of checking for
uniqueness.

--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-performance by date:

Previous
From: Neil Conway
Date:
Subject: Re: Pg+Linux swap use
Next
From: Allen Landsidel
Date:
Subject: Re: index creation order?