how do functional indices work?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема how do functional indices work?
Дата
Msg-id 20010904075959.2626bbcc.depesz@depesz.pl
обсуждение исходный текст
Ответы Re: how do functional indices work?
Список pgsql-general
hi
i  have a question.
let's assume i have table users which is (id int4, person_id int4) - pkey'ed
on id with index on person_id.
next i have table people (id int4, fullname text) with pkey on id.
there is a foreign key between the two tables on users.person_id => people.id.
now i wrote a function, which given user id returns it's person's name. quite
simple function.
not i want to make a index:
create index test on users (myMagicalFunction(id));
this of course works, but the question is:
how this index will work if i'll modify the fullname in people table? would it
be automatically updated? if yes then how pgsql knows where to update this
index? if no - is there any possible workaround that can be done?

depesz

--
hubert depesz lubaczewski                          http://www.depesz.pl/
------------------------------------------------------------------------
... vows are spoken to be broken ...                 [enjoy the silence]
... words are meaningless and forgettable ...             [depeche mode]

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

Предыдущее
От: David Ford
Дата:
Сообщение: is there a function/variable with remote host addr?
Следующее
От: Stephan Bergmann
Дата:
Сообщение: Re: SHOW