Re: Caching of Queries - Mailing list pgsql-performance

From Pierre-Frédéric Caillaud
Subject Re: Caching of Queries
Date
Msg-id opsfaqckygcq72hf@musicbox
Whole thread Raw
In response to Re: Caching of Queries  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
> 1) The materialized data is available in 3 different forms; a list, a
> detail
> view, and a spreadsheet.  Each form as somewhat different columns and
> different rules about ordering, which would likely confuse an SQC
> planner.
> In this implementation, all 3 forms are able to share the same cache.

    See my proposal to cache function results.
    You can create a cached function and :

    SELECT your rows FROM cached_function(parameters) WHERE ... ORDER BY...
GROUP BY...

    will only fetch the function result from the cache, and then the only
additional costs are the ORDER and GROUP BY... the query parsing is very
simple, it's just a select, and a "cached function scan"

    I think caching can be made much more powerful if it is made usable like
this. I mean, not only cache a query and its result, but being able to use
cached queries internally like this and manipulaing them, adds value to
the cached data and allows storing less data in the cache because
duplicates are avoided. Thus we could use cached results in CHECK()
conditions, inside plsql functions, anywhere...

pgsql-performance by date:

Previous
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: Caching of Queries
Next
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: Caching of Queries