Re: Query in cache - Mailing list pgsql-performance

From Sergey Konoplev
Subject Re: Query in cache
Date
Msg-id CAL_0b1t40UkK2JFBiR00oU1iXqbmvCe4dK+m1JpMWqDEHubaag@mail.gmail.com
Whole thread Raw
In response to Query in cache  (Rogerio Pereira <rogerio.pereira@riosoft.com.br>)
List pgsql-performance
2013/11/18 Rogerio Pereira <rogerio.pereira@riosoft.com.br>
> I am need help, about subject "Query cache in  Postgres".
> how is it possible to put sql statements cached in postgres ?
> I did some tests and I can not get even with improved tuning
> parameters in the postgresql.conf.

Are you talking about prepared statements or about query result caching?

If former then you need to look at the PREPARE for execute statement
[1], though it is probably implemented in your data adapter, for
example like it is in DBD::Pg [2]. Also take a look at the pre_prepare
module [3], that can conveniently be used with pgbouncer.

If later then there is an extension named pgmemcache [4] that will
allow you to interact with memcached directly from postgres, so you
could implement cashing in stored functions, for example. However my
advice is to use application level caching with memcached in this
case, not the database level one.

[1] http://www.postgresql.org/docs/9.3/static/sql-prepare.html
[2] http://search.cpan.org/dist/DBD-Pg/Pg.pm#prepare
[3] https://github.com/dimitri/preprepare
[4] https://github.com/ohmu/pgmemcache/

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com


pgsql-performance by date:

Previous
From: salah jubeh
Date:
Subject: Re: Query in cache
Next
From: "ktm@rice.edu"
Date:
Subject: Re: Query in cache