Re: stats are way off on 8.4 b1

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: stats are way off on 8.4 b1
Date: 2009-04-18 12:02:08
Message-ID: 2f4958ff0904180502x65dd00b5r614bba6ce73eb7ef@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2009/4/18 Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>:
> 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-04-19 23:31:51 Re: No hash join across partitioned tables?
Previous Message Heikki Linnakangas 2009-04-18 06:59:27 Re: stats are way off on 8.4 b1