Re: cross column correlation revisted
От | Joshua Tolley |
---|---|
Тема | Re: cross column correlation revisted |
Дата | |
Msg-id | 4c3dd33d.4814e70a.7d5e.3aca@mx.google.com обсуждение исходный текст |
Ответ на | Re: cross column correlation revisted (PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>) |
Список | pgsql-hackers |
On Wed, Jul 14, 2010 at 04:41:01PM +0200, PostgreSQL - Hans-Jürgen Schönig wrote: > 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 justa byproduct. > the core thing is: how can i estimate the number of rows returned from a join? All the discussion of this topic that I've seen has been limited to the single table case. The hard problem in that case is coming up with something you can precalculate that will actually be useful during query planning, without taking too much disk, memory, CPU, or something else. Expanding the discussion to include join relations certainly still has valid use cases, but is even harder, because you've also got to keep track of precisely how the underlying relations are joined, so you know in what context the statistics remain valid. So it makes sense to tackle the single table version first. Once it's implemented somehow, and has been proven sufficiently effective to merit the increased code size and complexity, we can consider expanding it to joined relations. -- Joshua Tolley / eggyknap End Point Corporation http://www.endpoint.com
В списке pgsql-hackers по дате отправления: