Skip site navigation (1) Skip section navigation (2)

Re: Simulate database fragmentation

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Y Sidhu <ysidhu(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Simulate database fragmentation
Date: 2007-05-27 16:05:38
Message-ID: 20070527160538.GO92628@nasby.net (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, May 23, 2007 at 11:58:06AM -0700, Y Sidhu wrote:
> Is there any easy way to take a database and add/delete records to create
> fragmentation of the records and indexes. I am trying to recreate high
> vacuum times.

Update random rows, then do a vacuum. That will result in free space in
random locations. At that point you'd probably want to update some
ranges of rows, enough so that they get forced to new pages.

A better idea might be to just insert random data.
-- 
Jim Nasby                                      decibel(at)decibel(dot)org
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

In response to

pgsql-performance by date

Next:From: Jim C. NasbyDate: 2007-05-27 16:06:48
Subject: Re: Memory allocation and Vacuum abends
Previous:From: Jim C. NasbyDate: 2007-05-27 15:59:42
Subject: Re: Domains versus Check Constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group