Thread: Caching in PostgreSQL

Caching in PostgreSQL

From
Date:

Hi,

    Can anybody tell me how can I implement data Caching in the
shared memory using PostgreSQL.

    For one of the projects we are using Postgres version 8.0.3 and
were planning to support table partitioning in order to improve the DB
query/update performance but, it will be very much helpful if anybody
can tell me whether data cache is possible in Postgres.

We also, need to know if the DB view is kept in the DB Managers program
memory or in the shared memory of the processor. If it is in the shared
memory, we only need to know the shared memory address/name so that we
can access. If not in shared memory then we need know whether it is
possible to make the postgress to store the DB view in shared memory.

Thanks in Advance,
Ram.


The information contained in this electronic message and any attachments to this message are intended for the exclusive
useof the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended
recipient,you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy
allcopies of this message and any attachments.  

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for
thepresence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

Re: Caching in PostgreSQL

From
Heikki Linnakangas
Date:
ramachandra.bhaskaram@wipro.com wrote:
>
> Hi,
>
>     Can anybody tell me how can I implement data Caching in the
> shared memory using PostgreSQL.

PostgreSQL, like most other DBMS, caches data pages in shared memory.
What exactly are you trying to accomplish? Are you having a performance
problem?

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: Caching in PostgreSQL

From
Date:
Hi Heikki Linnakangas,

    Thanks for yoru kind response.

    We were looking on how to improve the performance of our
application which is using PostgreSQL as backend.    If postgreSQL is
supporting data page caching in the shared memory then we wanted to
design our application to read/write using the shared memory rather than
accessing the DB everytime so that, it will improve the performance of
our system.

    If this is possible can you please tell us how can we implement
the same.     Any idea on the same is of very much help.

Thanks in Advance,
Ramachandra B.S.

-----Original Message-----
From: Heikki Linnakangas [mailto:hlinnaka@gmail.com] On Behalf Of Heikki
Linnakangas
Sent: Tuesday, January 16, 2007 3:04 PM
To: Ramachandra Bhaskaram (WT01 - IP-Multimedia Carrier & Ent Networks)
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Caching in PostgreSQL

ramachandra.bhaskaram@wipro.com wrote:
>
> Hi,
>
>     Can anybody tell me how can I implement data Caching in the
shared
> memory using PostgreSQL.

PostgreSQL, like most other DBMS, caches data pages in shared memory.
What exactly are you trying to accomplish? Are you having a performance
problem?

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com


The information contained in this electronic message and any attachments to this message are intended for the exclusive
useof the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended
recipient,you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy
allcopies of this message and any attachments.  

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for
thepresence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

Re: Caching in PostgreSQL

From
Heikki Linnakangas
Date:
ramachandra.bhaskaram@wipro.com wrote:
>     We were looking on how to improve the performance of our
> application which is using PostgreSQL as backend.    If postgreSQL is
> supporting data page caching in the shared memory then we wanted to
> design our application to read/write using the shared memory rather than
> accessing the DB everytime so that, it will improve the performance of
> our system.

That's a bad idea. Just design your database schema with performance in
mind, and use PostgreSQL normally with SQL queries. If you must, use a
general-purpose caching library in your application, instead of trying
to peek into PostgreSQL internals.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: Caching in PostgreSQL

From
"David Levy"
Date:
I am using memcached (http://www.danga.com/memcached/) to cache Postgres ADODB recordsets.
It's very efficient but has to be implemented in your own application.


On 1/16/07, Heikki Linnakangas <heikki@enterprisedb.com> wrote:
ramachandra.bhaskaram@wipro.com wrote:
>       We were looking on how to improve the performance of our
> application which is using PostgreSQL as backend.    If postgreSQL is
> supporting data page caching in the shared memory then we wanted to
> design our application to read/write using the shared memory rather than
> accessing the DB everytime so that, it will improve the performance of
> our system.

That's a bad idea. Just design your database schema with performance in
mind, and use PostgreSQL normally with SQL queries. If you must, use a
general-purpose caching library in your application, instead of trying
to peek into PostgreSQL internals.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org



--
David LEVY aka Selenium
Zlio.com & Col.fr
Blog       : http://www.davidlevy.org
ZlioShop : http://shop.davidlevy.org

Re: Caching in PostgreSQL

From
Chris Browne
Date:
ramachandra.bhaskaram@wipro.com writes:
>     Can anybody tell me how can I implement data Caching in the
> shared memory using PostgreSQL.

PostgreSQL already does that.

Implementing this functionality is rather tricky: Between version 7.4
and now, it has seen *massive* change which has required a great deal
of effort on the part of various developers.

Reimplementing it without a well-tested, well-thought-out alternative
proposal isn't likely to happen...
--
let name="cbbrowne" and tld="linuxfinances.info" in name ^ "@" ^ tld;;
http://linuxfinances.info/info/emacs.html
"Just because it's free doesn't mean you can afford it."  -- Unknown