Skip site navigation (1) Skip section navigation (2)

Re: index creation order?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Allen Landsidel <all(at)biosys(dot)net>,pgsql-performance(at)postgresql(dot)org
Subject: Re: index creation order?
Date: 2003-10-31 18:58:19
Message-ID: 200310311058.19455.josh@agliodbs.com (view raw or flat)
Thread:
Lists: 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

In response to

Responses

pgsql-performance by date

Next:From: Allen LandsidelDate: 2003-10-31 19:01:28
Subject: Re: index creation order?
Previous:From: scott.marloweDate: 2003-10-31 18:52:35
Subject: Re: Pg+Linux swap use

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group