From: Greg Stark <gsstark@mit.edu>
To: wyx6fox@sina.com
Cc: pgsql-performance@postgresql.org
Subject: Re: use pgsql in a big project, but i found pg has some big problem on concurrency write operation, maybe a joke for myself !
Date: Tue, 2 Feb 2010 16:08:53 +0000
Message-ID: <407d949e1002020808s4235a7d6p541029ead3cab629@mail.gmail.com> (raw)
In-Reply-To: <20100202043959.7C1354B1C26@mail175-236.sinamail.sina.com.cn>
References: <20100202043959.7C1354B1C26@mail175-236.sinamail.sina.com.cn>
2010/2/2 <wyx6fox@sina.com>:
> UPDATE webpages SET hits = hits + 1 WHERE url ='some url ';
>
> when concurrency write transaction on read committed isolation , the hits
> may result wrong .
That should work fine. All updates for the same url will be serialized.
The rest I'm pretty uncertain about what you're describing but I think
you may want to check about whether you need indexes on the other side
of your foreign key constraints. If you're deleting records that are
referred to by your foreign keys or you're updating the primary key
then you'll want this index on the table with the foreign key
constraint as well as the mandatory one on the referenced table.
--
greg
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: gsstark@mit.edu, wyx6fox@sina.com
Subject: Re: use pgsql in a big project, but i found pg has some big problem on concurrency write operation, maybe a joke for myself !
In-Reply-To: <407d949e1002020808s4235a7d6p541029ead3cab629@mail.gmail.com>
References: <20100202043959.7C1354B1C26@mail175-236.sinamail.sina.com.cn> <407d949e1002020808s4235a7d6p541029ead3cab629@mail.gmail.com>
* 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