Re: Does iscachable work?

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: FFabrizio(at)exchange(dot)webmd(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: Does iscachable work?
Date: 2002-02-22 23:13:11
Message-ID: 20020222231311.78329.qmail@web20802.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If "entityid" has a lot of unique values, you won't
get much gain from caching. My experience is that the
gain can be stunning in cases where there are few
distinct values in a column. The best way to know the
benefit in a given case is to test it.

If your function is highly computation-intensive, or
(for example) makes selects against the database that
require full table scans, then you will see slow
results no matter what.

--- root <ffabrizio(at)exchange(dot)webmd(dot)net> wrote:
>
> Hello,
>
> I'm running PostgreSQL 7.1.3, and I have a query
> that uses one of my
> functions:
>
> select findregion(entityid) from msg200;
>
> The findregion function is set to be 'with
> (iscachable)'. However, the
> query takes upwards of 40 seconds to run,
> consistently. The table only
> has 20000 rows or so. It doesn't seem like the
> caching is working.
>
> The only other time I tried to use function results
> caching, it actually
> consistently increased my execution time. Anything
> I need to be doing
> differently?
>
> Thanks,
> Fran
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-02-22 23:55:44 Re: Speed comparison to Oracle. Why was this query slower on pgsql?
Previous Message Martijn van Oosterhout 2002-02-22 22:27:01 Re: Speed comparison to Oracle. Why was this query slower on pgsql?