From: Pavel Velikhov <pvelikhov@yahoo.com>
To: Jonah H. Harris <jonah.harris@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: need help with a query
Date: Fri, 19 Oct 2007 09:11:36 -0700 (PDT)
Message-ID: <499575.37238.qm@web56407.mail.re3.yahoo.com> (raw)
Thanks for you help!
Got a very different query plan this time, with a hash join between links and articles. At least now postgres is using both shared memory buffers and working mem, but its still completely IO bound, only getting in 5-6% CPU once in a while. I guess I can't squeeze more out of the laptop, but I also have a machine with 16GB RAM that I'll try this on next. Should I allocate tons of memory into shared buffers or into the working memory?
Thanks in advance!
----- Original Message ----
From: Jonah H. Harris <jonah.harris@gmail.com>
To: Pavel Velikhov <pvelikhov@yahoo.com>
Cc: pgsql-performance@postgresql.org
Sent: Friday, October 19, 2007 7:52:58 PM
Subject: Re: [PERFORM] need help with a query
On 10/19/07, Pavel Velikhov <pvelikhov@yahoo.com> wrote:
>
> Hi,
>
> I am updating a big table (90M records) with data from another
rather
> large table (4M entries). Here is my update query:
>
> update links set target_size =
> ( select size from articles where articles.article_id =
> links.article_to)
try:
UPDATE links
SET target_size = size
FROM articles
WHERE articles.article_id = links.article_to;
--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/
---------------------------(end of
broadcast)---------------------------
TIP 6: explain analyze is your friend
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
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-performance@postgresql.org
Cc: pvelikhov@yahoo.com, jonah.harris@gmail.com
Subject: Re: need help with a query
In-Reply-To: <499575.37238.qm@web56407.mail.re3.yahoo.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