Обсуждение: pgsql-server/src/backend/commands cluster.c

Поиск
Список
Период
Сортировка

pgsql-server/src/backend/commands cluster.c

От
tgl@postgresql.org (Tom Lane)
Дата:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    tgl@postgresql.org    02/11/02 16:20:47

Modified files:
    src/backend/commands: cluster.c

Log message:
    During swap_relfilenodes, swap relation size statistic fields along with
    the relfilenode and toast fields.  This ensures that the newly-computed
    statistics will be available on completion of CLUSTER.


Re: pgsql-server/src/backend/commands cluster.c

От
Alvaro Herrera
Дата:
On Sat, Nov 02, 2002 at 04:20:47PM -0500, Tom Lane wrote:

> Log message:
>     During swap_relfilenodes, swap relation size statistic fields along with
>     the relfilenode and toast fields.  This ensures that the newly-computed
>     statistics will be available on completion of CLUSTER.

I haven't seen the change, but does this mean that ANALYZE is no longer
needed right after CLUSTER?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?"  (Mafalda)

Re: pgsql-server/src/backend/commands cluster.c

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> On Sat, Nov 02, 2002 at 04:20:47PM -0500, Tom Lane wrote:
>> During swap_relfilenodes, swap relation size statistic fields along with
>> the relfilenode and toast fields.  This ensures that the newly-computed
>> statistics will be available on completion of CLUSTER.

> I haven't seen the change, but does this mean that ANALYZE is no longer
> needed right after CLUSTER?

If the pg_statistic entries were already good, then you shouldn't need
an ANALYZE, no.

            regards, tom lane

Re: pgsql-server/src/backend/commands cluster.c

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> > On Sat, Nov 02, 2002 at 04:20:47PM -0500, Tom Lane wrote:
> >> During swap_relfilenodes, swap relation size statistic fields along with
> >> the relfilenode and toast fields.  This ensures that the newly-computed
> >> statistics will be available on completion of CLUSTER.
>
> > I haven't seen the change, but does this mean that ANALYZE is no longer
> > needed right after CLUSTER?
>
> If the pg_statistic entries were already good, then you shouldn't need
> an ANALYZE, no.

The CLUSTER manual page recommends a analyze to update the clustered
nature of the table.  Is that still needed?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/src/backend/commands cluster.c

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> If the pg_statistic entries were already good, then you shouldn't need
>> an ANALYZE, no.

> The CLUSTER manual page recommends a analyze to update the clustered
> nature of the table.  Is that still needed?

Oh, you're right, I was not thinking about the order-correlation
statistic.  Yes, ANALYZE is still needed if you want to update that
stat, which you probably do.  The swap hack just ensured that relpages
amd reltuples would be correct after a CLUSTER.

            regards, tom lane