Re: Query in cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/11/18 Rogerio Pereira <rogerio.pereira@xxxxxxxxxxxxxx>
> 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@xxxxxxxxx


-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux