2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								<?xml version="1.0" encoding="UTF-8"?>  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< !DOCTYPE html 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< html  xmlns = "http://www.w3.org/1999/xhtml"  xml:lang = "en"  lang = "en" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< head >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< link  rel = "icon"  type = "image/png"  href = "http://pgfoundry.org/images/elephant-icon.png"  / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< link  rel = "stylesheet"  type = "text/css"  href = "style.css"  / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< meta  http-equiv = "Content-Type"  content = "text/html; charset=UTF-8"  / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< title > pg_reorg: Project Home Page< / title > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / head >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< body >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< center > < img  style = "border: none; margin-left: auto; margin-right: auto; "  src = "http://pgfoundry.org/images/elephantSmall.png"  height = "75"  width = "75"  / >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< hr  / >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< h1 > Welcome to the pg_reorg Project Home Page< / h1 >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< hr  / >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / center >  
						 
					
						
							
								
									
										
										
										
											2010-03-25 07:13:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This project provides two tools for PostgreSQL; < strong > pg_reorg< / strong >  and < strong > pg_batch< / strong > .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
									
										
										
										
											2010-03-25 07:13:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< strong > pg_reorg< / strong >  can re-organize tables on a postgres database without any locks so that you can retrieve or update rows in tables being reorganized. 
						 
					
						
							
								
									
										
										
										
											2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								The module is developed to be a better alternative of CLUSTER and VACUUM FULL.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
									
										
										
										
											2010-03-25 07:13:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< strong > pg_batch< / strong >  is a SQL job executor program for PostgreSQL. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								It generates job list from an external SQL script file, and execute the jobs in serial or parallel.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								It can be used as "a better vacuumdb" with the attached script to run VACUUM.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The pg_reorg project is a < a  href = "http://www.postgresql.org" > PostgreSQL< / a >  Community project that is a part of the < a  href = "http://pgfoundry.org" > pgFoundry< / a > .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The pgFoundry page for the project is at < a  href = "http://pgfoundry.org/projects/reorg" > http://pgfoundry.org/projects/reorg< / a > , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								where you can find < a  href = "http://pgfoundry.org/frs/?group_id=1000411" > downloads< / a > , documentation, bug reports, mailing lists, and a whole lot more.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< a  href = "index-ja.html" > 日本語のページはこちら。< / a >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< hr  / >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< h2 > Documentation< / h2 >  
						 
					
						
							
								
									
										
										
										
											2010-03-25 07:13:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< ul >  
						 
					
						
							
								
									
										
										
										
											2010-06-01 07:35:01 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< li > < a  href = "pg_reorg.html" > pg_reorg 1.1 documentation< / a > < / li >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< li > < a  href = "pg_batch.html" > pg_batch 1.2 documentation< / a > < / li >  
						 
					
						
							
								
									
										
										
										
											2010-03-25 07:13:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< / ul >  
						 
					
						
							
								
									
										
										
										
											2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< h2 > Execution time< / h2 >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Here is a comparison between pg_reorg and clusterdb.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Clusterdb is faster on not fragmented conditions, but pg_reorg is faster on fully fragmented conditions.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Since reorganization is needed only if tables are fragmented, pg_reorg should be faster than clusterdb.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< center >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< div  style = "margin: 2em" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< img  src = "result.png"  / >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< table  border = "1" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< caption > Configuration< / caption >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< th > Category< / th > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< th > Item< / th > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< th > Details< / th > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td  rowspan = "3" > Hardware< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > CPU< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > 2 * Xeon 5160 3.00GHz (Dual core)< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > Memory< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > 2GB< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > Storage< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > Ultra320 SCSI, 15000rpm (220GB)< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td  rowspan = "4" > Software< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > OS< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > RHEL 5.2 (64bit) 2.6.18-92.el5< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > DB< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > PostgreSQL 8.3.3< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > pg_reorg< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > 1.0.0< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > clusterdb< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > clusterdb (PostgreSQL) 8.3.3< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td  rowspan = "2" > Data< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > Scheme< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > < code > < pre > CREATE TABLE tbl (
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 id bigserial PRIMARY KEY,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 seqkey timestamp NOT NULL,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 rndkey timestamp NOT NULL,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 filler char(75) NOT NULL
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								CREATE INDEX idx_seq ON tbl (seqkey);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								CREATE INDEX idx_rnd ON tbl (rndkey);< / pre > < / code > < / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > Rows< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									< td > 16.5 M rows (2GB)< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / tr >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / table >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / center >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< hr  / >  
						 
					
						
							
								
									
										
										
										
											2011-04-29 05:06:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< p  class = "footer" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Portions Copyright (c) 2008-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION< br  / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Portions Copyright (c) 2011, Itagaki Takahiro
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
									
										
										
										
											2009-12-28 08:25:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< script  type = "text/javascript" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< script  type = "text/javascript" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								try {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								var pageTracker = _gat._getTracker("UA-10244036-4");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								pageTracker._trackPageview();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} catch(err) {}< / script > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / body >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / html >