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

pg_stats.avg_width differs by a factor of 4 on different machines

From: Craig de Stigter <craig(dot)destigter(at)koordinates(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_stats.avg_width differs by a factor of 4 on different machines
Date: 2009-05-28 22:12:22
Message-ID: e260aad40905281512x75c0984n2d741054bd08cb69@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi list

We are using the PostgreSQL pg_stats view to estimate file sizes for some
geodata exports. However, the following query gives us totally different
results on different servers:

select avg_width from pg_stats where tablename='some_geodata' and attname =
> 'GEOMETRY';
>

PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Ubuntu
4.3.2-1ubuntu11) 4.3.2

> 81803
>

PostgreSQL 8.2.9 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.2
(Ubuntu 4.1.2-0ubuntu4)

> 20450
>

Both tables have had VACUUM FULL ANALYZE run on them and have identical
data. Note that 81803 is almost exactly 4x20450, though I don't know what
significance this has. x64/i386 makes no difference.

I couldn't find anything in the 8.3 release notes that looked relevant. Any
help appreciated.

Regards
Craig de Stigter

-- 
Koordinates Ltd
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Fax +64-9-969 0045
Web http://www.koordinates.com

Responses

pgsql-general by date

Next:From: Jeff DavisDate: 2009-05-28 22:39:57
Subject: Re: What is the right way to deal with a table with rows that are not in a random order?
Previous:From: Douglas AlanDate: 2009-05-28 22:02:30
Subject: Re: What is the right way to deal with a table with rows that are not in a random order?

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