Re: [GENERAL] Function index qeustion

Поиск
Список
Период
Сортировка
Искать

Re: [GENERAL] Function index qeustion

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Jonathan Bartlett  writes:
> 1) If you have an index on a cacheable function, does PostgreSQL use the
> index instead of calculating the results?

Not in general --- only for an indexscan lookup.

> 2) How does PostgreSQL know when to recompute the function?

Never.  That's what the iscachable flag means: you are promising that
the function's output for given input never changes.  If you aren't
prepared to make that promise, you cannot index the function.

			regards, tom lane
FAQ