pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Jean-Michel POURE <jm.poure@freesurf.fr>
To: Samuel J. Sutjiono <ssutjiono@wc-group.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: Transactional vs. Read-only (Retrieval) database
Date: Thu, 11 Apr 2002 16:25:34 +0200
Message-ID: <200204111625.34863.jm.poure@freesurf.fr> (raw)
In-Reply-To: <003801c1e15a$c03c5450$110a010a@headquarters.wcgroup.com>
References: <003801c1e15a$c03c5450$110a010a@headquarters.wcgroup.com>
Le Jeudi 11 Avril 2002 15:14, Samuel J. Sutjiono a écrit :
> I'd like to get some opinions if there are any benefits (i.e. in terms of
> performance) of creating two separate databases, one for transactions
> (insert, update, delete) and the other one is for retrieval/search
> (select).
Dear Samuel,
You do not need to create two separate databases. It is possible to write
server-side code to copy static data (read-only) to other tables. This can be
done using triggers and/or cron jobs.
A more sopisticated solution would be to store LEFT JOIN query results in the
original table using triggers. For example : you have tables COMPANY and
EMPLOYEE. Instead of running a LEFT JOIN on EMPLOYEE->COMPANY, it is possible
to store COMPANY name in table employee using a trigger.
Then, you don't need LEFT JOINS any more, simple SELECTs are enough, which is
fantastic for heavy loaded databases.
Same as for many operations. Try the EXPLAIN clause on a query. If too heavy,
try to write some code to simplify the query using triggers...
PostgreSQL is the most advanced open-source database available today. It has
several server-side languages (plpgsql, plperl, plpython). Maybe you should
try plpgsql which is easy to learn.
Well-optimized, PostgreSQL can run 10 times faster than well-known open-source
databases. If you need to test server-side programming, do not hesitate to
download and install pgAdmin2 (http://pgadmin.postgresql.org), PostgreSQL
Windows GUI.
Cheers,
Jean-Michel
view thread (5+ messages) latest in thread
Message-ID: <200204111625.34863.jm.poure@freesurf.fr> Permalink: ../200204111625.34863.jm.poure@freesurf.fr/ Also on: postgresql.org/message-id/200204111625.34863.jm.poure@freesurf.fr ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-sql@postgresql.org Cc: jm.poure@freesurf.fr, ssutjiono@wc-group.com, pgsql-general@postgresql.org Subject: Re: Transactional vs. Read-only (Retrieval) database In-Reply-To: <200204111625.34863.jm.poure@freesurf.fr> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox