Using an index to materialize a function

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Using an index to materialize a function
Date: 2013-08-16 17:54:30
Message-ID: CAGYyBgjahboymmn3ZbjRpC3MJdQ2FkDZ+NbUzbXd8Kj0QkcJCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If I have a slow_function(), and I create an index of
slow_function(field), will Postgres use that index to avoid having to
recompute the function?

Example:

SELECT slow_function(field1) FROM table1 WHERE id = 5

It won't use the index on field1 to _find_ the record. Can it use it
to compute the field?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert James 2013-08-16 18:04:18 Does string a begin with string b?
Previous Message Adrian Klaver 2013-08-16 17:41:47 Re: Listing privileges on a schema