Re: Hints WAS: Index Tuning Features

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Hints WAS: Index Tuning Features
Дата
Msg-id 87vempkz31.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Hints WAS: Index Tuning Features  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> 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?).

Except that the distribution is a property of the values you're passing it,
not the function itself. In theory verify_pk_signature() returns false for
99.999...% of its inputs. But of course unless you have a black hat or
hardware problems you're not going to ever pass it any input that makes it
return false. 

The query may be a routine session cookie check where it will virtually always
return true, or it may be a DBA running an ad-hoc query to check suspicious
records for invalid data. It may even be the same query from the same object
method being called from different call sites in the application.

I'm not saying the above isn't a good idea though. I rather like it actually.
But the point of my example originally was specifically to show how at least
sometimes the *only* place the knowledge of the data distribution lies is in
the programmer's head.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Bucky Jordan"
Дата:
Сообщение: Re: [PERFORM] Hints proposal
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: On status data and summaries