From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | "John D(dot) Burger" <john(at)mitre(dot)org> |
Cc: | Michael Crozier <crozierm(at)conducivetech(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: pgstattuple output? |
Date: | 2006-01-26 16:41:06 |
Message-ID: | 20060126164106.GA12001@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Jan 26, 2006 at 10:13:52AM -0500, John D. Burger wrote:
> I suspect that if a transaction rolls back, any inserts done in the
> interim turn into dead tuples.
Yep:
test=> CREATE TABLE foo (x integer);
CREATE TABLE
test=> BEGIN; INSERT INTO foo SELECT 1 FROM generate_series(1, 10000); ROLLBACK;
BEGIN
INSERT 0 10000
ROLLBACK
test=> INSERT INTO foo SELECT 1 FROM generate_series(1, 20000);
INSERT 0 20000
test=> \x
Expanded display is on.
test=> SELECT * FROM pgstattuple('foo');
-[ RECORD 1 ]------+--------
table_len | 1089536
tuple_count | 20000
tuple_len | 640000
tuple_percent | 58.74
dead_tuple_count | 10000
dead_tuple_len | 320000
dead_tuple_percent | 29.37
free_space | 6872
free_percent | 0.63
test=> VACUUM foo;
VACUUM
test=> SELECT * FROM pgstattuple('foo');
-[ RECORD 1 ]------+--------
table_len | 1089536
tuple_count | 20000
tuple_len | 640000
tuple_percent | 58.74
dead_tuple_count | 0
dead_tuple_len | 0
dead_tuple_percent | 0
free_space | 326692
free_percent | 29.98
--
Michael Fuhr
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2006-01-26 16:47:53 | Re: Query optimization with X Y JOIN |
Previous Message | Joshua D. Drake | 2006-01-26 16:34:11 | Re: Query optimization with X Y JOIN |