Re: Difference in query plan - Mailing list pgsql-performance

From Richard Huxton
Subject Re: Difference in query plan
Date
Msg-id 491DB1E9.6030500@archonet.com
Whole thread Raw
In response to Re: Difference in query plan  (Patrice Beliveau <pbeliveau@avior.ca>)
List pgsql-performance
Patrice Beliveau wrote:
> Thanks,
>
> I'm already doing a vacuum full every night on all database, but the
> REINDEX fix it and now it's working fine

Are you sure it was the REINDEX? The plan was using a sequential scan.

> But this raise a question
>
> 1) This table is cleared every night and recomputed, does this mean that
> I should REINDEX every night also

Looks like you should. Or drop the indexes, load the data, re-create the
indexes, that can be quicker.

> 2) Why this thing didn't happen in the other schema

Have you re-loaded schema1 more often? It might even be the particular
order that rows are loaded - a btree can become "unbalanced" sometimes.

--
  Richard Huxton
  Archonet Ltd

pgsql-performance by date:

Previous
From: Patrice Beliveau
Date:
Subject: Re: Difference in query plan
Next
From: "Віталій Тимчишин"
Date:
Subject: Re: PostgreSQL OR performance