Re: cross column correlation revisted

Поиск
Список
Период
Сортировка
От PostgreSQL - Hans-Jürgen Schönig
Тема Re: cross column correlation revisted
Дата
Msg-id A28B0AA5-34DA-4D5A-A78F-76E4F78FA310@cybertec.at
обсуждение исходный текст
Ответ на Re: cross column correlation revisted  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: cross column correlation revisted  (Joshua Tolley <eggyknap@gmail.com>)
Список pgsql-hackers
hello ...

look at the syntax i posted in more detail:

>>     ALTER TABLE x SET CORRELATION STATISTICS FOR (x.id = y.id AND x.id2 = y.id2)
>



it says X and Y ...
the selectivity of joins are what i am most interested in. cross correlation of columns within the same table are just
abyproduct. 
the core thing is: how can i estimate the number of rows returned from a join?

an example would be: you have a email accounts + messages. you know that each row will match in a join as you can
assumethat every account will have a message. 
what we need is a syntax which covers the join case and the case where columns inside the same table correlate.
and the fact that an index cannot cover two tables leads me to the conclusion that stats on an index are not the
solutionto the join problem. 
many thanks,
    hans


On Jul 14, 2010, at 4:22 PM, Tom Lane wrote:

> PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at> writes:
>> i think that having stats on an index is a problem by itself for 2 reasons - for cross column correlation at least:
>
>>     a.) joins cannot be covered by an index on two tables - we would fix "inside a table correlation problems" but
notjoins. 
>
> Your proposed command didn't cover the two-table case either, and anyway
> what the heck do you mean by cross-correlation across tables?
> Cross-correlation is about the correlation between values in the same
> row.
>
>>     b.) who says that there is actually an index in place?
>
> If the combination of columns is actually interesting, there might well
> be an index in place, or the DBA might be willing to create it.  For
> that matter, have you considered the idea of examining the index
> contents to derive the statistics?  Might work better than trying to get
> numbers via ANALYZE.
>
>             regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: five-key syscaches
Следующее
От: Robert Haas
Дата:
Сообщение: standard_conforming_strings