Re: Hints WAS: Index Tuning Features - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Hints WAS: Index Tuning Features
Date
Msg-id 20061012130635.GG11723@svana.org
Whole thread Raw
In response to Re: Hints WAS: Index Tuning Features  (Greg Stark <gsstark@mit.edu>)
Responses Re: Hints WAS: Index Tuning Features  (Simon Riggs <simon@2ndquadrant.com>)
Re: Hints WAS: Index Tuning Features  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
On Thu, Oct 12, 2006 at 08:50:04AM -0400, Greg Stark wrote:
> Not to say this isn't a good idea -- i think it's a great idea. But note that
> it doesn't solve some of the use cases of hints. Consider something like:
>
>   WHERE NOT radius_authenticate(suspected_hacker)
>
> or
>
>   WHERE NOT verify_pk_signature(document_we_have_no_reason_to_doubt)

We currently construct histograms for data in columns, there's no
particular reason why we can't do the same for functions. In a similar
vein, I don't see a reason why you couldn't enable a stats-gathering
mode where function calls would be instrumented to collect information
about:

- time of execution
- distribution of outputs

Which could then be used by the planner. Or more directly:

CREATE HISTOGRAM FOR FUNCTION verify_pk_signature(documenent)
AS ( true = 99, false = 1 );

(Perhaps DECLARE is the better phrase?).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Hints WAS: Index Tuning Features
Next
From: "Merlin Moncure"
Date:
Subject: Re: Database Auditing