From: Merlin Moncure <mmoncure@gmail.com>
To: Alexy Khrabrov <deliverable@gmail.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: two memory-consuming postgres processes
Date: Sat, 3 May 2008 11:07:11 -0400
Message-ID: <b42b73150805030807q23805b00yf122c4490fd0bc82@mail.gmail.com> (raw)
In-Reply-To: <EFF7D449-2965-4BAB-B127-387744C9CEDD@gmail.com>
References: <A728C858-76CF-473F-917B-3C9EA4AA75CF@gmail.com>
<dcc563d10805021230i5916561k3962a41e2afa894c@mail.gmail.com>
<27A4D379-2553-496D-A96C-102F2A5E62C2@gmail.com>
<dcc563d10805021253n1589baa7u559fdfc8053d23d3@mail.gmail.com>
<21403.1209759217@sss.pgh.pa.us>
<72E02D29-848B-467A-AE6B-401568010254@gmail.com>
<dcc563d10805021340u274ff4fegcf8902f66118d7c1@mail.gmail.com>
<EFF7D449-2965-4BAB-B127-387744C9CEDD@gmail.com>
On Fri, May 2, 2008 at 4:51 PM, Alexy Khrabrov <deliverable@gmail.com> wrote:
>
> On May 2, 2008, at 1:40 PM, Scott Marlowe wrote:
>
> > Again, a database protects your data from getting scrambled should the
> > program updating it quit halfway through etc...
> >
>
> Right -- but this is a data mining work, I add a derived column to a row,
> and it's computed from that very row and a small second table which should
> fit in RAM.
Full table update of a single field is one of the worst possible
operations with PostgreSQL. mysql is better at this because lack of
proper transactions and full table locking allow the rows to be
(mostly) updated in place. Ideally, you should be leveraging the
power of PostgreSQL so that you can avoid the full table update if
possible. Maybe if you step back and think about the problem you may
be able to come up with a solution that is more efficient.
Also, if you must do it this way, (as others suggest), do CREATE TABLE
new_table AS SELECT...., then create keys, and drop the old table when
done. This is much faster than update.
merlin
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: mmoncure@gmail.com, deliverable@gmail.com, scott.marlowe@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: two memory-consuming postgres processes
In-Reply-To: <b42b73150805030807q23805b00yf122c4490fd0bc82@mail.gmail.com>
References: <A728C858-76CF-473F-917B-3C9EA4AA75CF@gmail.com> <dcc563d10805021230i5916561k3962a41e2afa894c@mail.gmail.com> <27A4D379-2553-496D-A96C-102F2A5E62C2@gmail.com> <dcc563d10805021253n1589baa7u559fdfc8053d23d3@mail.gmail.com> <21403.1209759217@sss.pgh.pa.us> <72E02D29-848B-467A-AE6B-401568010254@gmail.com> <dcc563d10805021340u274ff4fegcf8902f66118d7c1@mail.gmail.com> <EFF7D449-2965-4BAB-B127-387744C9CEDD@gmail.com> <b42b73150805030807q23805b00yf122c4490fd0bc82@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