pg_stats.avg_width differs by a factor of 4 on different machines - Mailing list pgsql-general

From Craig de Stigter
Subject pg_stats.avg_width differs by a factor of 4 on different machines
Date
Msg-id e260aad40905281512x75c0984n2d741054bd08cb69@mail.gmail.com
Whole thread Raw
Responses Re: pg_stats.avg_width differs by a factor of 4 on different machines
List 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

pgsql-general by date:

Previous
From: Douglas Alan
Date:
Subject: Re: What is the right way to deal with a table with rows that are not in a random order?
Next
From: "Marcelo Giovane"
Date:
Subject: Please remove me from the list!