Re: limit clause breaks query planner?

From: "Matt Smiley" <mss(at)rentrak(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <david(dot)west(at)cusppoint(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: limit clause breaks query planner?
Date: 2008-09-04 18:45:37
Message-ID: 48BFCA55.D078.0028.0@rentrak.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> I'm not sure offhand whether the existing correlation stats would be of use for
> it, or whether we'd have to get ANALYZE to gather additional data.

Please forgive the tangent, but would it be practical to add support for gathering statistics on an arbitrary expression associated with a table, rather than just on materialized columns? For example:
analyze my_tab for expression 'my_func(my_tab.col)' ;
It seems like any time you'd consider using a functional index, this feature would let the planner calculate decent selectivity estimates for the expression's otherwise opaque data distribution. The expression might be treated as a virtual column on the table; not sure if that helps or hurts. Should I post this question on pgsql-hackers?

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ulrich 2008-09-04 19:24:18 More shared_buffers instead of effective_cache_size?
Previous Message Kiran Mukhyala 2008-09-04 18:21:52 inaccurate stats on large tables