Re: Help on query plan. - Mailing list pgsql-general

From William N. Zanatta
Subject Re: Help on query plan.
Date
Msg-id 3E2D8687.3090507@veritel.com.br
Whole thread Raw
In response to Re: Help on query plan.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Help on query plan.
List pgsql-general

> What does pg_stats show as the correlation value for the ip column?
> If you increase the statistics target and re-ANALYZE, does the
> correlation value change?
>
>             regards, tom lane

   well well well...let me see...I'm digging into an obscure
world...sorry I've never used a real database, just mysql heehe.

   OK, as I don't know what is much and what isn't for the stats target,
I tried to increase it firstly to 15 (10 is default according to
documentation) and then to 20. Results follow:


   No changes at all. Normal values since db build.
   ------------------------------------------------
access=# select correlation,attname from pg_stats where attname='ip';
  correlation | attname
-------------+---------
     0.202063 | ip
(1 row)


   Changing statistics target to 15
   ------------------------------------------------
access=# alter table tbl_access alter column ip set statistics 15;
ALTER TABLE
access=# analyze verbose tbl_access (ip);
INFO:  Analyzing public.tbl_access
ANALYZE
access=# select correlation,attname from pg_stats where attname='ip';
  correlation | attname
-------------+---------
      0.25932 | ip
(1 row)

   Changing statistics target to 20
   ------------------------------------------------
access=# alter table tbl_access alter column ip set statistics 20;
ALTER TABLE
access=# analyze verbose tbl_access (ip);
INFO:  Analyzing public.tbl_access
ANALYZE
access=# select correlation,attname from pg_stats where attname='ip';
  correlation | attname
-------------+---------
     0.213223 | ip
(1 row)


---------------------------------------------------------

   Is there any place I can find more about how to better analyze the
data postgresql offers me? It looks really helpfull...

   Thanks,

william


--
Perl combines all of the worst aspects of BASIC, C and line noise.
                 -- Keith Packard


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: LWLockAcquire
Next
From: Tom Lane
Date:
Subject: Re: Help on query plan.