CLUSTER ALL patch

Started by Alvaro Herreraalmost 24 years ago12 messagespatches
Jump to latest
#1Alvaro Herrera
alvherre@atentus.com

Hi,

I attach the patch implementing CLUSTER ALL. Please review and apply to
HEAD if OK.

Thank you.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

Attachments:

cluster-all-3.patchapplication/octet-stream; name=cluster-all-3.patchDownload+443-56
#2Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#1)
Re: CLUSTER ALL patch

This has been saved for the 7.4 release:

http://candle.pha.pa.us/cgi-bin/pgpatches2

---------------------------------------------------------------------------

Alvaro Herrera wrote:

Hi,

I attach the patch implementing CLUSTER ALL. Please review and apply to
HEAD if OK.

Thank you.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  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
#3Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#1)
Re: CLUSTER ALL patch

Patch returned to author for revision.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

Hi,

I attach the patch implementing CLUSTER ALL. Please review and apply to
HEAD if OK.

Thank you.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  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
#4Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Bruce Momjian (#3)
Re: CLUSTER ALL patch

On Thu, Nov 07, 2002 at 02:08:00PM -0500, Bruce Momjian wrote:

Patch returned to author for revision.

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.

Please review.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

Attachments:

cluster-all-5.patchtext/plain; charset=us-asciiDownload+508-50
#5Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#4)
Re: CLUSTER ALL patch

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

On Thu, Nov 07, 2002 at 02:08:00PM -0500, Bruce Momjian wrote:

Patch returned to author for revision.

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.

Please review.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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
#6Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#4)
Re: CLUSTER ALL patch

Patch applied. Thanks.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

On Thu, Nov 07, 2002 at 02:08:00PM -0500, Bruce Momjian wrote:

Patch returned to author for revision.

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.

Please review.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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
#7Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#6)
Re: CLUSTER ALL patch

Is the clusterdb script now going to be removed?

Bruce Momjian writes:

Patch applied. Thanks.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

On Thu, Nov 07, 2002 at 02:08:00PM -0500, Bruce Momjian wrote:

Patch returned to author for revision.

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.

Please review.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Peter Eisentraut peter_e@gmx.net

#8Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Peter Eisentraut (#7)
Re: CLUSTER ALL patch

On Sun, Nov 17, 2002 at 02:17:20PM +0100, Peter Eisentraut wrote:

Is the clusterdb script now going to be removed?

I think it should be replaced by a version that uses the backend CLUSTER
ALL functionality, but if people think there's no need it can just be
removed.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La virtud es el justo medio entre dos defectos" (Aristoteles)

#9Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#7)
Re: CLUSTER ALL patch

Yes, clusterdb will be removed. Thanks for the reminder.

---------------------------------------------------------------------------

Peter Eisentraut wrote:

Is the clusterdb script now going to be removed?

Bruce Momjian writes:

Patch applied. Thanks.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

On Thu, Nov 07, 2002 at 02:08:00PM -0500, Bruce Momjian wrote:

Patch returned to author for revision.

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.

Please review.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  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
#10Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#8)
Re: CLUSTER ALL patch

Alvaro Herrera wrote:

On Sun, Nov 17, 2002 at 02:17:20PM +0100, Peter Eisentraut wrote:

Is the clusterdb script now going to be removed?

I think it should be replaced by a version that uses the backend CLUSTER
ALL functionality, but if people think there's no need it can just be
removed.

I don't see any need to keep it. We have vacuumdb only so we can vacuum
all databases.

Oh, hold, I now see that clusterdb _can_ do all databases, just like
vacuumdb. Seems we should keep it. Peter?

-- 
  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
#11Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#10)
Re: CLUSTER ALL patch

Bruce Momjian writes:

Oh, hold, I now see that clusterdb _can_ do all databases, just like
vacuumdb. Seems we should keep it. Peter?

Interesting. Do we recommend that users routine recluster all their
databases?

Perhaps we need a more general client-side tool to run some command on all
databases, so we could get rid of clusterdb, vacuumdb, reindexdb,
mycommandofthedaydb, etc.

--
Peter Eisentraut peter_e@gmx.net

#12Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#11)
Re: CLUSTER ALL patch

Peter Eisentraut wrote:

Bruce Momjian writes:

Oh, hold, I now see that clusterdb _can_ do all databases, just like
vacuumdb. Seems we should keep it. Peter?

Interesting. Do we recommend that users routine recluster all their
databases?

Perhaps we need a more general client-side tool to run some command on all
databases, so we could get rid of clusterdb, vacuumdb, reindexdb,
mycommandofthedaydb, etc.

Yes, I think that makes sense. I think we need to keep clusterdb
_until_ we get a more general solution.

-- 
  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