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!
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@xxxxxxxxx>
To: Pavel Velikhov <pvelikhov@xxxxxxxxx>
Cc: pgsql-performance@xxxxxxxxxxxxxx
Sent: Friday, October 19, 2007 7:52:58 PM
Subject: Re: need help with a query
On 10/19/07, Pavel Velikhov <pvelikhov@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
Edison, NJ 08837 | http://www.enterprisedb.com/
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
From: Jonah H. Harris <jonah.harris@xxxxxxxxx>
To: Pavel Velikhov <pvelikhov@xxxxxxxxx>
Cc: pgsql-performance@xxxxxxxxxxxxxx
Sent: Friday, October 19, 2007 7:52:58 PM
Subject: Re: need help with a query
On 10/19/07, Pavel Velikhov <pvelikhov@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
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