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

Started by Tom Laneover 23 years ago5 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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.

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Tom Lane (#1)
Re: pgsql-server/src/backend/commands cluster.c

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)

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: pgsql-server/src/backend/commands cluster.c

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: pgsql-server/src/backend/commands cluster.c

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
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: pgsql-server/src/backend/commands cluster.c

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