pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Craig James <cjames@emolecules.com>
Cc: sthomas@optionshouse.com, "pgsql-performance@postgresql.org" <pgsql-performance@postgresql.org>
Subject: Re: Thinking About Correlated Columns (again)
Date: Thu, 16 May 2013 08:15:02 +1200
Message-ID: <5193ECC6.4080901@archidevsys.co.nz> (raw)
In-Reply-To: <CAFwQ8rcSrwfJRgtP9GV_t-hKRR4=PmVeqCuGJ7wEnnO-9PD0wA@mail.gmail.com>
References: <5193AA62.2040700@optionshouse.com>
	<CAFwQ8rcSrwfJRgtP9GV_t-hKRR4=PmVeqCuGJ7wEnnO-9PD0wA@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 16/05/13 04:23, Craig James wrote:
> On Wed, May 15, 2013 at 8:31 AM, Shaun Thomas 
> <sthomas@optionshouse.com <mailto:sthomas@optionshouse.com>> wrote:
>
>     [Inefficient plans for correlated columns] has been a pain point
>     for quite a while. While we've had several discussions in the
>     area, it always seems to just kinda trail off and eventually
>     vanish every time it comes up.
>
[...]
>
> It's a very hard problem.  There's no way you can keep statistics 
> about all possible correlations since the number of possibilities is 
> O(N^2) with the number of columns.
Actually far worse: N!/(N - K)!K! summed over K=1...N, assuming the 
order of columns in the correlation is unimportant (otherwise it is N 
factorial) - based on my hazy recollection of the relevant maths...

[...]

Cheers,
Gavin

view thread (12+ messages)  latest in thread

Message-ID: <5193ECC6.4080901@archidevsys.co.nz>
Permalink:  ../5193ECC6.4080901@archidevsys.co.nz/
Also on:    postgresql.org/message-id/5193ECC6.4080901@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, cjames@emolecules.com
  Subject: Re: Thinking About Correlated Columns (again)
  In-Reply-To: <5193ECC6.4080901@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox