Re: Large Tables/clustering/terrible performance ofPostgresql - Mailing list pgsql-general

From Jeffrey W. Baker
Subject Re: Large Tables/clustering/terrible performance ofPostgresql
Date
Msg-id Pine.LNX.4.33.0112311349590.5617-100000@windmill.gghcwest.com
Whole thread Raw
List pgsql-general

On Mon, 31 Dec 2001, Michael McAlpine wrote:

> Thanks for the reply.
>
> Explain results:
>
> NOTICE:  QUERY PLAN:
>
> Seq Scan on table1  (cost=0.00..163277.83 rows=1 width=300)
>
> EXPLAIN

Welp, that's your problem I suspect!  Postgres is going to read every
single record in your table to find the result.  You need an index, and
Postgres needs to use it.  If you don't have an index, add one:

create index table1_name_idx on table1(name);

After you have an index, Postgres needs to learn to use it:

vacuum verbose analyze table1;

Then re-run explain and let us know how things shake out.

-jwb



pgsql-general by date:

Previous
From: "Jeffrey W. Baker"
Date:
Subject: 7.2 changes to varchar truncation
Next
From: Tom Lane
Date:
Subject: Re: Large Tables/clustering/terrible performance