Re: Help on query plan.

Поиск
Список
Период
Сортировка
От William N. Zanatta
Тема Re: Help on query plan.
Дата
Msg-id 3E2D8687.3090507@veritel.com.br
обсуждение исходный текст
Ответ на Re: Help on query plan.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Help on query plan.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: LWLockAcquire
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Help on query plan.