Re: Planner estimates and cast operations ,... - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: Planner estimates and cast operations ,...
Date
Msg-id 20060904181048.GA26868@wolff.to
Whole thread Raw
In response to Re: Planner estimates and cast operations ,...  (Hans-Juergen Schoenig <postgres@cybertec.at>)
List pgsql-hackers
On Mon, Sep 04, 2006 at 19:09:16 +0200, Hans-Juergen Schoenig <postgres@cybertec.at> wrote:
> 
> setting work_mem to 2gb does not help here ;)
> set it to the max value on 8.0.
> this was my first try too.
> the problem is - there is no magic switch to mislead the planner a  
> little without hacking the system stats (which is not what people  
> should do i would say ;) ).

Did you combine that with telling it not to use sorts? I am not sure that
will really work for GROUP BY, but it is probably an easy test. You can
do an explain to see what it will try without actually running the query
in case it picks the poor plan again.

> my question is: is adding hooks for selectivity a feasable way of  
> dealing with things like that?

I think the expectation is that you create a functional index and that's
how you would tell the system to keep stats for particular functions. I
don't think data on the most common values are kept now for functional
indexes, but the index itself will still have clues about the data.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Contrib module to examine client
Next
From: Bruce Momjian
Date:
Subject: Re: Getting a move on for 8.2 beta