Re: Functionscan estimates

От: Alvaro Herrera
Тема: Re: Functionscan estimates
Дата: ,
Msg-id: 20050408235731.GA6279@dcc.uchile.cl
(см: обсуждение, исходный текст)
Ответ на: Re: Functionscan estimates  (Josh Berkus)
Ответы: Re: Functionscan estimates  (Tom Lane)
Список: pgsql-performance

Скрыть дерево обсуждения

Functionscan estimates  (Josh Berkus, )
 Re: Functionscan estimates  (Michael Fuhr, )
  Re: Functionscan estimates  (Alvaro Herrera, )
   Re: Functionscan estimates  (Josh Berkus, )
    Re: Functionscan estimates  (Alvaro Herrera, )
     Re: Functionscan estimates  (Tom Lane, )
      Re: Functionscan estimates  (PFC, )
      Re: Functionscan estimates  ("Jim C. Nasby", )
       Re: Functionscan estimates  (Tom Lane, )
        Re: Functionscan estimates  (Neil Conway, )
         Re: Functionscan estimates  (Josh Berkus, )
      Re: Functionscan estimates  (Neil Conway, )
    Re: Functionscan estimates  (PFC, )

On Fri, Apr 08, 2005 at 04:04:27PM -0700, Josh Berkus wrote:

> My solution would be a lot simpler, since we could simply populate
> pg_proc.proestrows with "1000" by default if not changed by the DBA.  In an
> even better world, we could tie it to a table, saying that, for example,
> proestrows = my_table*0.02.

The problem with that approach is that it can't differ depending on the
arguments to the function, so it too seems limited to me.

Ideally an estimator would be able to peek at other table statistics and
do some computation with them, just like other nodes are able to.

Another idea would be have an estimator function (pg_proc.proestimator)
for each regular function.  The estimator would be a very cheap function
to be called with the same arguments, and it would return the estimated
number of tuples the other function would return.  The default estimator
could be "return 1000".

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"A wizard is never late, Frodo Baggins, nor is he early.
 He arrives precisely when he means to."  (Gandalf, en LoTR FoTR)


В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Functionscan estimates
От: PFC
Дата:
Сообщение: Re: Functionscan estimates