Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: stats are way off on 8.4 b1 - Mailing list pgsql-performance

From Grzegorz Jaśkiewicz
Subject Re: stats are way off on 8.4 b1
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: stats are way off on 8.4 b1  (Heikki Linnakangas <[email protected]>)
List pgsql-performance
2009/4/18 Heikki Linnakangas <[email protected]>:
> Grzegorz Jaśkiewicz wrote:
>>
>> Can correlation be negative ?
>
> Yes, if the data in the column are in descending order. For example:
>
> postgres=# CREATE TABLE foo(id int4);
> CREATE TABLE
> postgres=# INSERT INTO foo SELECT 1000 - generate_series(1, 1000);
> INSERT 0 1000
> postgres=# ANALYZE foo;
> ANALYZE
> postgres=# SELECT attname, correlation FROM pg_stats  WHERE tablename='foo';
>  attname | correlation
> ---------+-------------
>  id      |          -1
> (1 row)

aye, thanks.


--
GJ

pgsql-performance by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: stats are way off on 8.4 b1
Next
From: Tom Lane
Date:
Subject: Re: No hash join across partitioned tables?